Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

it-parallel-batch

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

it-parallel-batch - npm Package Compare versions

Comparing version 2.0.0 to 2.0.1

4

package.json
{
"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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc