Comparing version 1.4.4 to 1.4.5
26
index.js
@@ -84,6 +84,6 @@ 'use strict'; // always strict mode | ||
let handler = (async (...params) => { | ||
let out = await this._call (propPath, params); | ||
let out = await this._call (propPath, params, path); | ||
if (out.isError) { | ||
throw out.data; | ||
throw new Error(out.data); | ||
} else { | ||
@@ -158,4 +158,5 @@ return out.data; | ||
// Find internal handler | ||
// Find internal handler and parent | ||
let handler = objectPath.get (this._child, call.path); | ||
let parent = objectPath.get (this._child, call.parentPath); | ||
@@ -187,3 +188,3 @@ // Handle inexistence | ||
// Run with applied params and await result | ||
response = await handler.bind (this._child) (...params); | ||
response = await handler.bind (parent) (...params); | ||
} catch (err) { | ||
@@ -207,3 +208,3 @@ // Emit error as response | ||
async _call (path, params) { | ||
async _call (path, params, parentPath) { | ||
// Generate ID to listen for responses on | ||
@@ -221,9 +222,9 @@ let resId = uuid (); | ||
return { | ||
isFunc: true, | ||
resId: cbResId, | ||
isFunc : true, | ||
resId : cbResId, | ||
} | ||
} else { | ||
return { | ||
isFunc: false, | ||
data: param, | ||
isFunc : false, | ||
data : param, | ||
} | ||
@@ -235,5 +236,6 @@ } | ||
this._stream.send ('fnCall', { | ||
path: path, | ||
resId: resId, | ||
params: parsedParams, | ||
path : path, | ||
parentPath : parentPath, | ||
resId : resId, | ||
params : parsedParams, | ||
}); | ||
@@ -240,0 +242,0 @@ |
{ | ||
"name": "arc-rpc", | ||
"version": "1.4.4", | ||
"version": "1.4.5", | ||
"description": "Asynchronous Remote Classes make RPC simple", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12776
317