/
var
/
www
/
greso.tech
/
server
/
nsm
/
node_modules
/
async
/
/var/www/greso.tech/server/nsm/node_modules/async
mkdir
upload
Name
Size
Mode
Actions
dist/
-
0755
rm
internal/
-
0755
rm
all.js
3558
0644
edit
dl
rm
allLimit.js
1750
0644
edit
dl
rm
allSeries.js
1644
0644
edit
dl
rm
any.js
3802
0644
edit
dl
rm
anyLimit.js
1785
0644
edit
dl
rm
anySeries.js
1679
0644
edit
dl
rm
apply.js
3121
0644
edit
dl
rm
applyEach.js
1989
0644
edit
dl
rm
applyEachSeries.js
1303
0644
edit
dl
rm
asyncify.js
3739
0644
edit
dl
rm
auto.js
11856
0644
edit
dl
rm
autoInject.js
7092
0644
edit
dl
rm
bower.json
239
0644
edit
dl
rm
cargo.js
2745
0644
edit
dl
rm
cargoQueue.js
3351
0644
edit
dl
rm
CHANGELOG.md
33377
0644
edit
dl
rm
compose.js
1564
0644
edit
dl
rm
concat.js
3651
0644
edit
dl
rm
concatLimit.js
2096
0644
edit
dl
rm
concatSeries.js
1473
0644
edit
dl
rm
constant.js
2977
0644
edit
dl
rm
detect.js
3248
0644
edit
dl
rm
detectLimit.js
1834
0644
edit
dl
rm
detectSeries.js
1740
0644
edit
dl
rm
dir.js
1297
0644
edit
dl
rm
doDuring.js
2303
0644
edit
dl
rm
doUntil.js
1706
0644
edit
dl
rm
doWhilst.js
2303
0644
edit
dl
rm
during.js
2333
0644
edit
dl
rm
each.js
4024
0644
edit
dl
rm
eachLimit.js
1789
0644
edit
dl
rm
eachOf.js
5746
0644
edit
dl
rm
eachOfLimit.js
1637
0644
edit
dl
rm
eachOfSeries.js
1329
0644
edit
dl
rm
eachSeries.js
1575
0644
edit
dl
rm
ensureAsync.js
2314
0644
edit
dl
rm
every.js
3558
0644
edit
dl
rm
everyLimit.js
1750
0644
edit
dl
rm
everySeries.js
1644
0644
edit
dl
rm
filter.js
2897
0644
edit
dl
rm
filterLimit.js
1654
0644
edit
dl
rm
filterSeries.js
1546
0644
edit
dl
rm
find.js
3248
0644
edit
dl
rm
findLimit.js
1834
0644
edit
dl
rm
findSeries.js
1740
0644
edit
dl
rm
flatMap.js
3651
0644
edit
dl
rm
flatMapLimit.js
2096
0644
edit
dl
rm
flatMapSeries.js
1473
0644
edit
dl
rm
foldl.js
4881
0644
edit
dl
rm
foldr.js
1498
0644
edit
dl
rm
forEach.js
4024
0644
edit
dl
rm
forEachLimit.js
1789
0644
edit
dl
rm
forEachOf.js
5746
0644
edit
dl
rm
forEachOfLimit.js
1637
0644
edit
dl
rm
forEachOfSeries.js
1329
0644
edit
dl
rm
forEachSeries.js
1575
0644
edit
dl
rm
forever.js
2121
0644
edit
dl
rm
groupBy.js
3597
0644
edit
dl
rm
groupByLimit.js
2449
0644
edit
dl
rm
groupBySeries.js
1330
0644
edit
dl
rm
index.js
19730
0644
edit
dl
rm
inject.js
4881
0644
edit
dl
rm
LICENSE
1063
0644
edit
dl
rm
log.js
1197
0644
edit
dl
rm
map.js
4595
0644
edit
dl
rm
mapLimit.js
1619
0644
edit
dl
rm
mapSeries.js
1514
0644
edit
dl
rm
mapValues.js
4589
0644
edit
dl
rm
mapValuesLimit.js
2120
0644
edit
dl
rm
mapValuesSeries.js
1377
0644
edit
dl
rm
memoize.js
3073
0644
edit
dl
rm
nextTick.js
1478
0644
edit
dl
rm
package.json
2204
0644
edit
dl
rm
parallel.js
5573
0644
edit
dl
rm
parallelLimit.js
1510
0644
edit
dl
rm
priorityQueue.js
2712
0644
edit
dl
rm
queue.js
7380
0644
edit
dl
rm
race.js
2135
0644
edit
dl
rm
README.md
3216
0644
edit
dl
rm
reduce.js
4881
0644
edit
dl
rm
reduceRight.js
1498
0644
edit
dl
rm
reflect.js
2269
0644
edit
dl
rm
reflectAll.js
2452
0644
edit
dl
rm
reject.js
2675
0644
edit
dl
rm
rejectLimit.js
1577
0644
edit
dl
rm
rejectSeries.js
1469
0644
edit
dl
rm
retry.js
5527
0644
edit
dl
rm
retryable.js
2538
0644
edit
dl
rm
select.js
2897
0644
edit
dl
rm
selectLimit.js
1654
0644
edit
dl
rm
selectSeries.js
1546
0644
edit
dl
rm
seq.js
2656
0644
edit
dl
rm
series.js
5822
0644
edit
dl
rm
setImmediate.js
1392
0644
edit
dl
rm
some.js
3802
0644
edit
dl
rm
someLimit.js
1785
0644
edit
dl
rm
someSeries.js
1679
0644
edit
dl
rm
sortBy.js
6213
0644
edit
dl
rm
timeout.js
2758
0644
edit
dl
rm
times.js
1486
0644
edit
dl
rm
timesLimit.js
1448
0644
edit
dl
rm
timesSeries.js
1060
0644
edit
dl
rm
transform.js
5566
0644
edit
dl
rm
tryEach.js
2543
0644
edit
dl
rm
unmemoize.js
668
0644
edit
dl
rm
until.js
2077
0644
edit
dl
rm
waterfall.js
3206
0644
edit
dl
rm
whilst.js
2333
0644
edit
dl
rm
wrapSync.js
3739
0644
edit
dl
rm
Edit:
/var/www/greso.tech/server/nsm/node_modules/async/autoInject.js
(7092B)
'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*([^)]+)\s*\)(?:\s*{)/; var ARROW_FN_ARGS = /^(?:async\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'];
Save
cmd:
run