Comparing version 3.2.0 to 3.3.0
24
index.js
@@ -75,2 +75,26 @@ 'use strict' | ||
Protocol.hasImpl = function (proto, arg, args) { | ||
args = args || [] | ||
if (Object.getPrototypeOf(arg) === Array.prototype) { | ||
args = arg | ||
arg = null | ||
} | ||
var fns = proto._methodNames | ||
var gf | ||
for (var i = 0; i < fns.length; i++) { | ||
if (arg) { | ||
gf = arg[fns[i]] | ||
} else { | ||
gf = proto[fns[i]] | ||
} | ||
if (!gf || | ||
(gf.hasMethod | ||
? !gf.hasMethod.apply(gf, args) | ||
: typeof gf === 'function')) { | ||
return false | ||
} | ||
} | ||
return true | ||
} | ||
Protocol.impl = function (proto, target, types, implementations) { | ||
@@ -77,0 +101,0 @@ if (Object.getPrototypeOf(target) === Array.prototype) { |
{ | ||
"name": "protoduck", | ||
"version": "3.2.0", | ||
"version": "3.3.0", | ||
"description": "Fancy duck typing for the most serious of ducks.", | ||
@@ -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
17928
165