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

forEachAsync

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

forEachAsync - npm Package Compare versions

Comparing version 2.1.1 to 2.2.0

README.md

30

forEachAsync.js

@@ -0,1 +1,2 @@

/*jshint strict:true node:true es5:true onevar:true laxcomma:true laxbreak:true*/
(function () {

@@ -6,17 +7,32 @@ "use strict";

function forEachAsync(arr, callback) {
var sequence = Sequence();
function handleItem(item, i, arr) {
var seq = this
;
function handleItem(item, i, arr) {
sequence.then(function (next) {
callback(next, item, i, arr);
});
function nextItem(next, BREAK) {
if (forEachAsync.BREAK === BREAK) {
process.nextTick(function () {
next(forEachAsync.BREAK);
});
return;
}
seq._contextCallback.call(this, next, item, i, arr);
}
arr.forEach(handleItem);
seq.then(nextItem);
}
function forEachAsync(arr, callback, _context) {
var sequence = Sequence.create(_context);
sequence._contextCallback = callback;
arr.forEach(handleItem, sequence);
return sequence;
}
forEachAsync.BREAK = '__forEachAsync_BREAK__';
module.exports = forEachAsync;
}());
{
"name": "forEachAsync",
"version": "2.1.1",
"version": "2.2.0",
"description": "The forEachAsync module of FuturesJS (Ender.JS and Node.JS)",

@@ -17,3 +17,3 @@ "homepage": "https://github.com/coolaj86/futures",

"dependencies": {
"sequence": ">= 2.1.1"
"sequence": ">= 2.2.1"
},

@@ -20,0 +20,0 @@ "engines": {

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