Fix comments-server
This commit is contained in:
parent
73c27aec6a
commit
9165b96e0f
@ -1,9 +1,8 @@
|
||||
export type Id = number | string
|
||||
import {ArgumentTypes, FunctionPropertyNames, RetType} from './types'
|
||||
import {isPromise} from './isPromise'
|
||||
import { getValidatorsForInstance, getValidatorsForMethod, Validate } from './ensure'
|
||||
import { createError, ErrorResponse } from './error'
|
||||
import {getValidatorsForMethod, getValidatorsForInstance} from './ensure'
|
||||
import {Validate} from './ensure'
|
||||
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',
|
||||
|
||||
@ -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})
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user