diff --git a/packages/jsonrpc/src/jsonrpc.ts b/packages/jsonrpc/src/jsonrpc.ts index 7c80c7f..a685760 100644 --- a/packages/jsonrpc/src/jsonrpc.ts +++ b/packages/jsonrpc/src/jsonrpc.ts @@ -51,6 +51,7 @@ export function getAllMethods(obj: T): Array> { const l = Object.getOwnPropertyNames(obj) .filter((p, i, arr) => { return typeof (obj as any)[p] === 'function' && + p.startsWith('_') === false && p !== 'constructor' }) .forEach(p => props.add(p)) @@ -144,7 +145,6 @@ export const createRpcService = >( const isNotification = req.id === null || req.id === undefined if ( - method.startsWith('_') || !rpcService.hasOwnProperty(method) || typeof rpcService[method] !== 'function' ) {