/usr/local/lib/node_modules/pm2/node_modules/async
NameSizeModeActions
dist/-0755rm
internal/-0755rm
all.js35590644editdlrm
allLimit.js17510644editdlrm
allSeries.js16450644editdlrm
any.js38030644editdlrm
anyLimit.js17860644editdlrm
anySeries.js16800644editdlrm
apply.js2170644editdlrm
applyEach.js19880644editdlrm
applyEachSeries.js13020644editdlrm
asyncify.js37620644editdlrm
auto.js118530644editdlrm
autoInject.js70990644editdlrm
bower.json2390644editdlrm
cargo.js27460644editdlrm
cargoQueue.js33520644editdlrm
CHANGELOG.md334810644editdlrm
compose.js15650644editdlrm
concat.js36520644editdlrm
concatLimit.js20930644editdlrm
concatSeries.js14740644editdlrm
constant.js3020644editdlrm
detect.js32490644editdlrm
detectLimit.js18350644editdlrm
detectSeries.js17410644editdlrm
dir.js12960644editdlrm
doDuring.js23000644editdlrm
doUntil.js17030644editdlrm
doWhilst.js23000644editdlrm
during.js23380644editdlrm
each.js40250644editdlrm
eachLimit.js17900644editdlrm
eachOf.js57430644editdlrm
eachOfLimit.js16380644editdlrm
eachOfSeries.js13300644editdlrm
eachSeries.js15760644editdlrm
ensureAsync.js23110644editdlrm
every.js35590644editdlrm
everyLimit.js17510644editdlrm
everySeries.js16450644editdlrm
filter.js28980644editdlrm
filterLimit.js16550644editdlrm
filterSeries.js15470644editdlrm
find.js32490644editdlrm
findLimit.js18350644editdlrm
findSeries.js17410644editdlrm
flatMap.js36520644editdlrm
flatMapLimit.js20930644editdlrm
flatMapSeries.js14740644editdlrm
foldl.js48780644editdlrm
foldr.js15010644editdlrm
forEach.js40250644editdlrm
forEachLimit.js17900644editdlrm
forEachOf.js57430644editdlrm
forEachOfLimit.js16380644editdlrm
forEachOfSeries.js13300644editdlrm
forEachSeries.js15760644editdlrm
forever.js21180644editdlrm
groupBy.js35980644editdlrm
groupByLimit.js24460644editdlrm
groupBySeries.js13310644editdlrm
index.js199400644editdlrm
inject.js48780644editdlrm
LICENSE10630644editdlrm
log.js11960644editdlrm
map.js45960644editdlrm
mapLimit.js16200644editdlrm
mapSeries.js15150644editdlrm
mapValues.js45900644editdlrm
mapValuesLimit.js21170644editdlrm
mapValuesSeries.js13780644editdlrm
memoize.js30700644editdlrm
nextTick.js14750644editdlrm
package.json22030644editdlrm
parallel.js55740644editdlrm
parallelLimit.js15110644editdlrm
priorityQueue.js14420644editdlrm
queue.js6260644editdlrm
race.js21320644editdlrm
README.md32170644editdlrm
reduce.js48780644editdlrm
reduceRight.js15010644editdlrm
reflect.js22660644editdlrm
reflectAll.js24490644editdlrm
reject.js26760644editdlrm
rejectLimit.js15780644editdlrm
rejectSeries.js14700644editdlrm
retry.js55240644editdlrm
retryable.js25350644editdlrm
select.js28980644editdlrm
selectLimit.js16550644editdlrm
selectSeries.js15470644editdlrm
seq.js26530644editdlrm
series.js58230644editdlrm
setImmediate.js13910644editdlrm
some.js38030644editdlrm
someLimit.js17860644editdlrm
someSeries.js16800644editdlrm
sortBy.js62100644editdlrm
timeout.js27550644editdlrm
times.js14870644editdlrm
timesLimit.js14510644editdlrm
timesSeries.js10610644editdlrm
transform.js55630644editdlrm
tryEach.js25400644editdlrm
unmemoize.js6650644editdlrm
until.js20800644editdlrm
waterfall.js32030644editdlrm
whilst.js23380644editdlrm
wrapSync.js37620644editdlrm
Edit: /usr/local/lib/node_modules/pm2/node_modules/async/autoInject.js (7099B)
'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = autoInject; var _auto = require('./auto.js'); var _auto2 = _interopRequireDefault(_auto); var _wrapAsync = require('./internal/wrapAsync.js'); var _wrapAsync2 = _interopRequireDefault(_wrapAsync); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var FN_ARGS = /^(?:async\s)?(?:function)?\s*(?:\w+\s*)?\(([^)]+)\)(?:\s*{)/; var ARROW_FN_ARGS = /^(?:async\s)?\s*(?:\(\s*)?((?:[^)=\s]\s*)*)(?:\)\s*)?=>/; var FN_ARG_SPLIT = /,/; var FN_ARG = /(=.+)?(\s*)$/; function stripComments(string) { let stripped = ''; let index = 0; let endBlockComment = string.indexOf('*/'); while (index < string.length) { if (string[index] === '/' && string[index + 1] === '/') { // inline comment let endIndex = string.indexOf('\n', index); index = endIndex === -1 ? string.length : endIndex; } else if (endBlockComment !== -1 && string[index] === '/' && string[index + 1] === '*') { // block comment let endIndex = string.indexOf('*/', index); if (endIndex !== -1) { index = endIndex + 2; endBlockComment = string.indexOf('*/', index); } else { stripped += string[index]; index++; } } else { stripped += string[index]; index++; } } return stripped; } function parseParams(func) { const src = stripComments(func.toString()); let match = src.match(FN_ARGS); if (!match) { match = src.match(ARROW_FN_ARGS); } if (!match) throw new Error('could not parse args in autoInject\nSource:\n' + src); let [, args] = match; return args.replace(/\s/g, '').split(FN_ARG_SPLIT).map(arg => arg.replace(FN_ARG, '').trim()); } /** * A dependency-injected version of the [async.auto]{@link module:ControlFlow.auto} function. Dependent * tasks are specified as parameters to the function, after the usual callback * parameter, with the parameter names matching the names of the tasks it * depends on. This can provide even more readable task graphs which can be * easier to maintain. * * If a final callback is specified, the task results are similarly injected, * specified as named parameters after the initial error parameter. * * The autoInject function is purely syntactic sugar and its semantics are * otherwise equivalent to [async.auto]{@link module:ControlFlow.auto}. * * @name autoInject * @static * @memberOf module:ControlFlow * @method * @see [async.auto]{@link module:ControlFlow.auto} * @category Control Flow * @param {Object} tasks - An object, each of whose properties is an {@link AsyncFunction} of * the form 'func([dependencies...], callback). The object's key of a property * serves as the name of the task defined by that property, i.e. can be used * when specifying requirements for other tasks. * * The `callback` parameter is a `callback(err, result)` which must be called * when finished, passing an `error` (which can be `null`) and the result of * the function's execution. The remaining parameters name other tasks on * which the task is dependent, and the results from those tasks are the * arguments of those parameters. * @param {Function} [callback] - An optional callback which is called when all * the tasks have been completed. It receives the `err` argument if any `tasks` * pass an error to their callback, and a `results` object with any completed * task results, similar to `auto`. * @returns {Promise} a promise, if no callback is passed * @example * * // The example from `auto` can be rewritten as follows: * async.autoInject({ * get_data: function(callback) { * // async code to get some data * callback(null, 'data', 'converted to array'); * }, * make_folder: function(callback) { * // async code to create a directory to store a file in * // this is run at the same time as getting the data * callback(null, 'folder'); * }, * write_file: function(get_data, make_folder, callback) { * // once there is some data and the directory exists, * // write the data to a file in the directory * callback(null, 'filename'); * }, * email_link: function(write_file, callback) { * // once the file is written let's email a link to it... * // write_file contains the filename returned by write_file. * callback(null, {'file':write_file, 'email':'user@example.com'}); * } * }, function(err, results) { * console.log('err = ', err); * console.log('email_link = ', results.email_link); * }); * * // If you are using a JS minifier that mangles parameter names, `autoInject` * // will not work with plain functions, since the parameter names will be * // collapsed to a single letter identifier. To work around this, you can * // explicitly specify the names of the parameters your task function needs * // in an array, similar to Angular.js dependency injection. * * // This still has an advantage over plain `auto`, since the results a task * // depends on are still spread into arguments. * async.autoInject({ * //... * write_file: ['get_data', 'make_folder', function(get_data, make_folder, callback) { * callback(null, 'filename'); * }], * email_link: ['write_file', function(write_file, callback) { * callback(null, {'file':write_file, 'email':'user@example.com'}); * }] * //... * }, function(err, results) { * console.log('err = ', err); * console.log('email_link = ', results.email_link); * }); */ function autoInject(tasks, callback) { var newTasks = {}; Object.keys(tasks).forEach(key => { var taskFn = tasks[key]; var params; var fnIsAsync = (0, _wrapAsync.isAsync)(taskFn); var hasNoDeps = !fnIsAsync && taskFn.length === 1 || fnIsAsync && taskFn.length === 0; if (Array.isArray(taskFn)) { params = [...taskFn]; taskFn = params.pop(); newTasks[key] = params.concat(params.length > 0 ? newTask : taskFn); } else if (hasNoDeps) { // no dependencies, use the function as-is newTasks[key] = taskFn; } else { params = parseParams(taskFn); if (taskFn.length === 0 && !fnIsAsync && params.length === 0) { throw new Error("autoInject task functions require explicit parameters."); } // remove callback param if (!fnIsAsync) params.pop(); newTasks[key] = params.concat(newTask); } function newTask(results, taskCb) { var newArgs = params.map(name => results[name]); newArgs.push(taskCb); (0, _wrapAsync2.default)(taskFn)(...newArgs); } }); return (0, _auto2.default)(newTasks, callback); } module.exports = exports.default;