Comparing version 1.0.5 to 1.0.6
@@ -22,15 +22,25 @@ var wrappy = require('wrappy') | ||
var args = slice(arguments) | ||
for (var i = 0; i < len; i++) { | ||
cbs[i].apply(null, args) | ||
// XXX It's somewhat ambiguous whether a new callback added in this | ||
// pass should be queued for later execution if something in the | ||
// list of callbacks throws, or if it should just be discarded. | ||
// However, it's such an edge case that it hardly matters, and either | ||
// choice is likely as surprising as the other. | ||
// As it happens, we do go ahead and schedule it for later execution. | ||
try { | ||
for (var i = 0; i < len; i++) { | ||
cbs[i].apply(null, args) | ||
} | ||
} finally { | ||
if (cbs.length > len) { | ||
// added more in the interim. | ||
// de-zalgo, just in case, but don't call again. | ||
cbs.splice(0, len) | ||
process.nextTick(function () { | ||
RES.apply(null, args) | ||
}) | ||
} else { | ||
delete reqs[key] | ||
} | ||
} | ||
if (cbs.length > len) { | ||
// added more in the interim. | ||
// de-zalgo, just in case, but don't call again. | ||
cbs.splice(0, len) | ||
process.nextTick(function () { | ||
RES.apply(null, args) | ||
}) | ||
} else { | ||
delete reqs[key] | ||
} | ||
}) | ||
@@ -37,0 +47,0 @@ } |
{ | ||
"name": "inflight", | ||
"version": "1.0.5", | ||
"version": "1.0.6", | ||
"description": "Add callbacks to requests in flight to avoid async duplication", | ||
@@ -14,6 +14,6 @@ "main": "inflight.js", | ||
"devDependencies": { | ||
"tap": "^1.2.0" | ||
"tap": "^7.1.2" | ||
}, | ||
"scripts": { | ||
"test": "tap test.js" | ||
"test": "tap test.js --100" | ||
}, | ||
@@ -20,0 +20,0 @@ "repository": { |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
3762
48
0