New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

fastparallel

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fastparallel - npm Package Compare versions

Comparing version 2.0.1 to 2.1.0

2

package.json
{
"name": "fastparallel",
"version": "2.0.1",
"version": "2.1.0",
"description": "Zero-overhead asynchronous parallel/each/map function call",

@@ -5,0 +5,0 @@ "main": "parallel.js",

@@ -66,7 +66,8 @@ 'use strict'

function goResultsArray (that, toCall, arg, holder) {
function goResultsArray (that, funcs, arg, holder) {
var singleCaller = null
holder._count = toCall.length
var toCall = nop
holder._count = funcs.length
holder._results = new Array(holder._count)
for (var i = 0; i < toCall.length; i++) {
for (var i = 0; i < funcs.length; i++) {
singleCaller = queueSingleCaller.get()

@@ -76,3 +77,8 @@ singleCaller._release = singleCallerRelease

singleCaller.pos = i
toCall[i].call(that, arg, singleCaller.release)
toCall = funcs[i]
if (toCall.length === 1) {
toCall.call(that, singleCaller.release)
} else {
toCall.call(that, arg, singleCaller.release)
}
}

@@ -88,6 +94,12 @@ }

function goNoResultsArray (that, toCall, arg, holder) {
holder._count = toCall.length
for (var i = 0; i < toCall.length; i++) {
toCall[i].call(that, arg, holder.release)
function goNoResultsArray (that, funcs, arg, holder) {
var toCall = null
holder._count = funcs.length
for (var i = 0; i < funcs.length; i++) {
toCall = funcs[i]
if (toCall.length === 1) {
toCall.call(that, holder.release)
} else {
toCall.call(that, arg, holder.release)
}
}

@@ -94,0 +106,0 @@ }

@@ -350,1 +350,43 @@ var test = require('tape')

})
test('call without arg if there is no arg with no results', function (t) {
t.plan(3)
var instance = parallel({
results: false
})
var count = 0
var obj = {}
instance(obj, [something, something], 42, function done () {
t.equal(count, 2, 'all functions must have completed')
})
function something (cb) {
t.equal(obj, this)
setImmediate(function () {
count++
cb()
})
}
})
test('call without arg if there is no arg with results', function (t) {
t.plan(3)
var instance = parallel()
var count = 0
var obj = {}
instance(obj, [something, something], 42, function done () {
t.equal(count, 2, 'all functions must have completed')
})
function something (cb) {
t.equal(obj, this)
setImmediate(function () {
count++
cb()
})
}
})
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