/usr/lib/nodejs/array-series/index.js is in node-array-series 0.1.5-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | module.exports = function series(fns, context, callback) {
if (!callback) {
if (typeof context === 'function') {
callback = context
context = null
} else {
callback = noop
}
}
if (!(fns && fns.length)) return callback();
fns = fns.slice(0)
var call = context
? function () {
fns.length
? fns.shift().call(context, next)
: callback()
}
: function () {
fns.length
? fns.shift()(next)
: callback()
}
call()
function next(err) {
err ? callback(err) : call()
}
}
function noop() {}
|