it-parallel-batch
Advanced tools
Comparing version 2.0.0 to 2.0.1
{ | ||
"name": "it-parallel-batch", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "Takes an async iterator that emits promise-returning functions, invokes them in parallel and emits the results in the same order as the input", | ||
@@ -141,3 +141,3 @@ "author": "Alex Potsides <alex@achingbrain.net>", | ||
"devDependencies": { | ||
"aegir": "^37.5.0", | ||
"aegir": "^38.1.7", | ||
"delay": "^5.0.0", | ||
@@ -144,0 +144,0 @@ "it-all": "^2.0.0" |
@@ -18,5 +18,5 @@ import batch from 'it-batch' | ||
*/ | ||
export default async function * parallelBatch <T> (source: AsyncIterable<() => Promise<T>>|Iterable<() => Promise<T>>, size: number = 1): AsyncGenerator<T, void, undefined> { | ||
export default async function * parallelBatch <T> (source: AsyncIterable<() => Promise<T>> | Iterable<() => Promise<T>>, size: number = 1): AsyncGenerator<T, void, undefined> { | ||
for await (const tasks of batch(source, size)) { | ||
const things: Array<Promise<Success<T>|Failure>> = tasks.map( | ||
const things: Array<Promise<Success<T> | Failure>> = tasks.map( | ||
async (p: () => Promise<T>) => { | ||
@@ -23,0 +23,0 @@ return await p().then(value => ({ ok: true, value }), err => ({ ok: false, err })) |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
8727
0