This commit is contained in:
2019-09-21 14:31:40 +02:00
parent 67278ff2fe
commit ac9e6d3732
5 changed files with 10 additions and 10 deletions
+1 -1
View File
@@ -46,7 +46,7 @@ export class RPCServer<
if(badRPC = exporters.flatMap(ex => ex.exportRPCs()).find(rpc => !rpc.name))
throw new Error(`
RPC did not provide a name.
\nUse funtion name(..){ .. } syntax instead.
\nUse 'funtion name(..){ .. }' syntax instead.
\n
\n<------------OFFENDING RPC:
\n`+badRPC.toString()+`
+4 -4
View File
@@ -48,7 +48,7 @@ export type BaseInfo = {
export type HookInfo<T = {}> = BaseInfo & {
type: 'Hook',
generator: (socket) => HookFunction<T>
generator: (socket?:I.Socket) => HookFunction<T>
}
export type CallInfo = BaseInfo & {
@@ -61,6 +61,6 @@ export type ExtendedRpcInfo = RpcInfo & { uniqueName: string }
export type OnFunction = (type: 'error' | 'close', f: (e?:any)=>void) => I.Socket
export type HookCloseFunction<T = {}> = (res:SubscriptionResponse<T>, rpc:HookRPC<T>) => any
export type HookFunction<T = {}> = (...args:[any, ...any[]]) => Promise<SubscriptionResponse<T> | ErrorResponse>
export type AsyncFunction = (...args:any[]) => Promise<any>
export type CallbackFunction = (...args:any[]) => void
export type HookFunction<T = {}> = (...args:any) => Promise<SubscriptionResponse<T> | ErrorResponse>
export type AsyncFunction = (...args:any) => Promise<any>
export type CallbackFunction = (...args:any) => void
+1 -1
View File
@@ -28,7 +28,7 @@ export const rpcToRpcinfo = <SubResT = {}>(rpc : T.RPC<SubResT>, owner: T.Owner)
case "function":
if(!rpc.name) throw new Error(`
RPC did not provide a name.
\nUse funtion name(..){ .. } syntax instead.
\nUse 'funtion name(..){ .. }' syntax instead.
\n
\n<------------OFFENDING RPC:
\n`+rpc.toString()+`