muxrpc-validation
Advanced tools
Comparing version 1.0.3 to 1.0.4
20
index.js
@@ -59,3 +59,3 @@ var zerr = require('zerr') | ||
// run sync fn | ||
return apply(fn, args) | ||
return apply(this, fn, args) | ||
} | ||
@@ -80,3 +80,3 @@ } | ||
// run async fn | ||
return apply(fn, args) | ||
return apply(this, fn, args) | ||
} | ||
@@ -94,3 +94,3 @@ } | ||
// run stream fn | ||
return apply(fn, args) | ||
return apply(this, fn, args) | ||
} | ||
@@ -158,14 +158,14 @@ } | ||
// helper to avoid apply, for performance | ||
function apply (fn, args) { | ||
function apply (self, fn, args) { | ||
if (args.length == 0) | ||
return fn() | ||
return fn.call(self) | ||
if (args.length == 1) | ||
return fn(args[0]) | ||
return fn.call(self, args[0]) | ||
if (args.length == 2) | ||
return fn(args[0], args[1]) | ||
return fn.call(self, args[0], args[1]) | ||
if (args.length == 3) | ||
return fn(args[0], args[1], args[2]) | ||
return fn.call(self, args[0], args[1], args[2]) | ||
if (args.length == 4) | ||
return fn(args[0], args[1], args[2], args[3]) | ||
return fn.apply(null, args) | ||
return fn.call(self, args[0], args[1], args[2], args[3]) | ||
return fn.apply(self, args) | ||
} |
{ | ||
"name": "muxrpc-validation", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "Validation library for muxrpc apis", | ||
@@ -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
5694