run-series
Advanced tools
Comparing version 1.0.2 to 1.1.0
12
index.js
@@ -0,12 +1,12 @@ | ||
var dezalgo = require('dezalgo') | ||
module.exports = function (tasks, cb) { | ||
var current = 0 | ||
var results = [] | ||
cb = cb || function () {} | ||
if (cb) cb = dezalgo(cb) | ||
function done (err, result) { | ||
if (err) return cb(err, results) | ||
results.push(result) | ||
if (++current >= tasks.length) { | ||
cb(null, results) | ||
if (++current >= tasks.length || err) { | ||
if (cb) cb(err, results) | ||
} else { | ||
@@ -20,4 +20,4 @@ tasks[current](done) | ||
} else { | ||
cb(null, []) | ||
if (cb) cb(null, results) | ||
} | ||
} |
{ | ||
"name": "run-series", | ||
"description": "Run an array of functions in series", | ||
"version": "1.0.2", | ||
"version": "1.1.0", | ||
"author": { | ||
@@ -13,5 +13,8 @@ "name": "Feross Aboukhadijeh", | ||
}, | ||
"dependencies": {}, | ||
"dependencies": { | ||
"dezalgo": "^1.0.1" | ||
}, | ||
"devDependencies": { | ||
"tape": "^2.12.3" | ||
"standard": "^3.2.0", | ||
"tape": "^3.5.0" | ||
}, | ||
@@ -36,3 +39,3 @@ "homepage": "https://github.com/feross/run-series", | ||
"scripts": { | ||
"test": "tape test/*.js" | ||
"test": "standard && tape test/*.js" | ||
}, | ||
@@ -39,0 +42,0 @@ "testling": { |
@@ -1,2 +0,2 @@ | ||
# run-series [![travis](https://img.shields.io/travis/feross/run-series.svg)](https://travis-ci.org/feross/run-series) [![npm](https://img.shields.io/npm/v/run-series.svg)](https://npmjs.org/package/run-series) | ||
# run-series [![travis](https://img.shields.io/travis/feross/run-series.svg)](https://travis-ci.org/feross/run-series) [![npm](https://img.shields.io/npm/v/run-series.svg)](https://npmjs.org/package/run-series) [![npm](https://img.shields.io/npm/dm/run-series.svg)](https://npmjs.org/package/run-series) | ||
@@ -3,0 +3,0 @@ ### Run an array of functions in series |
@@ -16,2 +16,2 @@ var series = require('../') | ||
t.end() | ||
}) | ||
}) |
@@ -23,2 +23,2 @@ var series = require('../') | ||
}) | ||
}) | ||
}) |
@@ -19,2 +19,2 @@ var series = require('../') | ||
series(tasks) | ||
}) | ||
}) |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
97877
129
1
2
+ Addeddezalgo@^1.0.1
+ Addedasap@2.0.6(transitive)
+ Addeddezalgo@1.0.4(transitive)
+ Addedwrappy@1.0.2(transitive)