marcosc-async
Advanced tools
Comparing version 3.0.3 to 3.0.4
@@ -12,6 +12,7 @@ /*jshint -W082 */ | ||
// It is called with zero or more arguments... | ||
return function asyncFunction(...args) { | ||
return function asyncFunction() { | ||
const args = Array.from(arguments); | ||
const gen = (function*() { | ||
return (func.constructor.name === 'GeneratorFunction') ? | ||
yield* func.call(self, ...args) : func.call(self, ...args); | ||
yield* func.apply(self, args) : func.apply(self, args); | ||
}()); | ||
@@ -23,5 +24,5 @@ try { | ||
} | ||
function step({value, done}) { | ||
const p = Promise.resolve(value); // Normalize thenables | ||
return (done) ? p : p | ||
function step(resultObj) { | ||
const p = Promise.resolve(resultObj.value); // Normalize thenables | ||
return (resultObj.done) ? p : p | ||
.then(result => step(gen.next(result))) | ||
@@ -28,0 +29,0 @@ .catch(error => step(gen.throw(error))); |
{ | ||
"name": "marcosc-async", | ||
"version": "3.0.3", | ||
"version": "3.0.4", | ||
"description": "Lightweight promise/generator machinery.", | ||
@@ -31,6 +31,7 @@ "main": "lib/async.js", | ||
"chai-as-promised": "^6.0.0", | ||
"jscs": "^3.0.5", | ||
"jshint": "^2.9.2", | ||
"mocha": "^3.0.2" | ||
} | ||
"jscs": "^3.0.7", | ||
"jshint": "^2.9.4", | ||
"mocha": "^3.1.2" | ||
}, | ||
"engines": ">=4" | ||
} |
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
31983
39