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

array-series

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

array-series - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

22

index.js

@@ -11,12 +11,18 @@ module.exports = function series(fns, context, callback) {

var length = fns.length
var length = fns && fns.length
if (!length) return callback();
var index = 0
fns = fns.slice(0)
var call = context ? function () {
fns[index].call(context, next)
} : function () {
fns[index](next)
var call = context
? function () {
fns.length
? fns.shift().call(context, next)
: callback()
}
: function () {
fns.length
? fns.shift()(next)
: callback()
}

@@ -26,5 +32,3 @@ call()

function next(err) {
if (err || ++index === length) return callback(err);
call()
err ? callback(err) : call()
}

@@ -31,0 +35,0 @@ }

{
"name": "array-series",
"description": "Call an array of asynchronous functions in series",
"version": "0.1.1",
"version": "0.1.2",
"scripts": {

@@ -6,0 +6,0 @@ "test": "node test"

@@ -86,2 +86,4 @@ var assert = require('assert')

assert.equal(o, undefined)
})
})
console.log('Array series tests pass!')
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