rpc-protocol
Advanced tools
Comparing version 0.1.1 to 0.1.2
{ | ||
"name": "rpc-protocol", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "Create and run commands over a RPC protocol stream", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -45,8 +45,12 @@ const serializeError = require('serialize-error') | ||
if ('function' === typeof value) { | ||
if ('function' !== value.toString().slice(0, 8)) { | ||
if ('(' !== value.toString()[0]) { | ||
value = `function ${value}` | ||
const original = value | ||
const isAsync = value.toString().match(/^async\s+/) | ||
let string = value.toString().replace(/^async\s+/, '') | ||
if (!/^function/.test(string)) { | ||
if ('(' !== string.toString()[0]) { | ||
value = `${isAsync ? 'async ' : ''}function ${string}` | ||
} | ||
} | ||
try { | ||
@@ -53,0 +57,0 @@ const source = `return ${value.toString()}` |
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
46655
1305