Comparing version 2.0.0 to 2.0.1
26
index.js
'use strict'; | ||
module.exports = (...input) => { | ||
if (input.length === 0) { | ||
module.exports = (...iterable) => { | ||
if (iterable.length === 0) { | ||
throw new Error('Expected at least one argument'); | ||
} | ||
const iterator = input[Symbol.iterator](); | ||
return input => { | ||
const iterator = iterable[Symbol.iterator](); | ||
const loop = async current => { | ||
const {done, value} = iterator.next(); | ||
const loop = async current => { | ||
const {done, value} = iterator.next(); | ||
if (done) { | ||
return current; | ||
} | ||
if (done) { | ||
return current; | ||
} | ||
const next = await value(current); | ||
return loop(next); | ||
const next = await value(current); | ||
return loop(next); | ||
}; | ||
return loop(input); | ||
}; | ||
return loop; | ||
}; |
{ | ||
"name": "p-pipe", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "Compose promise-returning & async functions into a reusable pipeline", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
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
6755
58