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

it-parallel

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

it-parallel - npm Package Compare versions

Comparing version 2.0.1 to 2.0.2

8

dist/index.d.ts
export = parallel;
/**
* @template T
* @typedef {object} Operation
* @property {boolean} done
* @property {boolean} ok
* @property {Error} err
* @property {T} value
*/
/**
* Takes an (async) iterator that emits promise-returning functions,

@@ -12,0 +4,0 @@ * invokes them in parallel and emits the results as they become available but

16

index.js

@@ -0,5 +1,5 @@

/* global EventTarget Event */
'use strict'
const defer = require('p-defer')
const EventEmitter = require('events').EventEmitter

@@ -15,2 +15,4 @@ /**

const CustomEvent = globalThis.CustomEvent || Event
/**

@@ -36,3 +38,3 @@ * Takes an (async) iterator that emits promise-returning functions,

const ordered = options.ordered == null ? false : options.ordered
const emitter = new EventEmitter()
const emitter = new EventTarget()

@@ -47,3 +49,3 @@ /** @type {Operation<T>[]}} */

emitter.on('task-complete', () => {
emitter.addEventListener('task-complete', () => {
resultAvailable.resolve()

@@ -77,7 +79,7 @@ })

op.value = result
emitter.emit('task-complete')
emitter.dispatchEvent(new CustomEvent('task-complete'))
}, err => {
op.done = true
op.err = err
emitter.emit('task-complete')
emitter.dispatchEvent(new CustomEvent('task-complete'))
})

@@ -87,6 +89,6 @@ }

sourceFinished = true
emitter.emit('task-complete')
emitter.dispatchEvent(new CustomEvent('task-complete'))
} catch (err) {
sourceErr = err
emitter.emit('task-complete')
emitter.dispatchEvent(new CustomEvent('task-complete'))
}

@@ -93,0 +95,0 @@ })

{
"name": "it-parallel",
"version": "2.0.1",
"version": "2.0.2",
"description": "Takes an (async) iterable that emits promise-returning functions, invokes them in parallel up to the concurrency limit and emits the results as they become available, optionally in the same order as the input",

@@ -40,3 +40,3 @@ "main": "index.js",

},
"gitHead": "29126fa87dae108acef381693812f22ac8f9362b"
"gitHead": "b621056a11c9bfe991d1040b22a46651fa907a3c"
}

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