Fix comments-server

This commit is contained in:
Jerko Steiner 2019-09-16 20:45:52 +07:00
parent 73c27aec6a
commit 9165b96e0f
2 changed files with 7 additions and 7 deletions

View File

@ -1,9 +1,8 @@
export type Id = number | string
import {ArgumentTypes, FunctionPropertyNames, RetType} from './types'
import {isPromise} from './isPromise'
import {createError, ErrorResponse} from './error'
import {getValidatorsForMethod, getValidatorsForInstance} from './ensure'
import {Validate} from './ensure'
import { getValidatorsForInstance, getValidatorsForMethod, Validate } from './ensure'
import { createError, ErrorResponse } from './error'
import { isPromise } from './isPromise'
import { ArgumentTypes, FunctionPropertyNames, RetType } from './types'
export const ERROR_PARSE = {
code: -32700,
@ -78,7 +77,8 @@ export interface SuccessResponse<T> {
export type Response<T = any> = SuccessResponse<T> | ErrorResponse<T>
export function createSuccessResponse<T>(
id: number | string, result: T
id: number | string,
result: T,
): SuccessResponse<T> {
return {
jsonrpc: '2.0',

View File

@ -26,7 +26,7 @@ describe('remote', () => {
return a + b
}
async fetchItem(
ctx: {}, obj1: {a: number}, obj2: {b: number}
ctx: {}, obj1: {a: number}, obj2: {b: number},
): Promise<{a: number, b: number}> {
return Promise.resolve({...obj1, ...obj2})
}