Linux ubuntu22 5.15.0-133-generic #144-Ubuntu SMP Fri Feb 7 20:47:38 UTC 2025 x86_64
nginx/1.18.0
: 128.199.27.159 | : 216.73.216.1
Cant Read [ /etc/named.conf ]
8.1.31
www-data
www.github.com/MadExploits
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
CPANEL RESET
CREATE WP USER
README
+ Create Folder
+ Create File
/
var /
www /
html /
quiz1 /
node_modules /
async /
[ HOME SHELL ]
Name
Size
Permission
Action
dist
[ DIR ]
dr-xr-xr-x
internal
[ DIR ]
dr-xr-xr-x
CHANGELOG.md
32.7
KB
-rw-rw-rw-
LICENSE
1.04
KB
-rw-rw-rw-
README.md
3.14
KB
-rw-rw-rw-
all.js
3.48
KB
-rw-rw-rw-
allLimit.js
1.71
KB
-rw-rw-rw-
allSeries.js
1.61
KB
-rw-rw-rw-
any.js
3.71
KB
-rw-rw-rw-
anyLimit.js
1.74
KB
-rw-rw-rw-
anySeries.js
1.64
KB
-rw-rw-rw-
apply.js
217
B
-rw-rw-rw-
applyEach.js
1.94
KB
-rw-rw-rw-
applyEachSeries.js
1.27
KB
-rw-rw-rw-
asyncify.js
3.67
KB
-rw-rw-rw-
auto.js
11.58
KB
-rw-rw-rw-
autoInject.js
6.93
KB
-rw-rw-rw-
bower.json
239
B
-rw-rw-rw-
cargo.js
2.68
KB
-rw-rw-rw-
cargoQueue.js
3.27
KB
-rw-rw-rw-
compose.js
1.53
KB
-rw-rw-rw-
concat.js
3.57
KB
-rw-rw-rw-
concatLimit.js
2.04
KB
-rw-rw-rw-
concatSeries.js
1.44
KB
-rw-rw-rw-
constant.js
302
B
-rw-rw-rw-
detect.js
3.17
KB
-rw-rw-rw-
detectLimit.js
1.79
KB
-rw-rw-rw-
detectSeries.js
1.7
KB
-rw-rw-rw-
dir.js
1.27
KB
-rw-rw-rw-
doDuring.js
2.25
KB
-rw-rw-rw-
doUntil.js
1.66
KB
-rw-rw-rw-
doWhilst.js
2.25
KB
-rw-rw-rw-
during.js
2.28
KB
-rw-rw-rw-
each.js
3.93
KB
-rw-rw-rw-
eachLimit.js
1.75
KB
-rw-rw-rw-
eachOf.js
5.61
KB
-rw-rw-rw-
eachOfLimit.js
1.6
KB
-rw-rw-rw-
eachOfSeries.js
1.3
KB
-rw-rw-rw-
eachSeries.js
1.54
KB
-rw-rw-rw-
ensureAsync.js
2.26
KB
-rw-rw-rw-
every.js
3.48
KB
-rw-rw-rw-
everyLimit.js
1.71
KB
-rw-rw-rw-
everySeries.js
1.61
KB
-rw-rw-rw-
filter.js
2.83
KB
-rw-rw-rw-
filterLimit.js
1.62
KB
-rw-rw-rw-
filterSeries.js
1.51
KB
-rw-rw-rw-
find.js
3.17
KB
-rw-rw-rw-
findLimit.js
1.79
KB
-rw-rw-rw-
findSeries.js
1.7
KB
-rw-rw-rw-
flatMap.js
3.57
KB
-rw-rw-rw-
flatMapLimit.js
2.04
KB
-rw-rw-rw-
flatMapSeries.js
1.44
KB
-rw-rw-rw-
foldl.js
4.76
KB
-rw-rw-rw-
foldr.js
1.47
KB
-rw-rw-rw-
forEach.js
3.93
KB
-rw-rw-rw-
forEachLimit.js
1.75
KB
-rw-rw-rw-
forEachOf.js
5.61
KB
-rw-rw-rw-
forEachOfLimit.js
1.6
KB
-rw-rw-rw-
forEachOfSeries.js
1.3
KB
-rw-rw-rw-
forEachSeries.js
1.54
KB
-rw-rw-rw-
forever.js
2.07
KB
-rw-rw-rw-
groupBy.js
3.51
KB
-rw-rw-rw-
groupByLimit.js
2.39
KB
-rw-rw-rw-
groupBySeries.js
1.3
KB
-rw-rw-rw-
index.js
19.47
KB
-rw-rw-rw-
inject.js
4.76
KB
-rw-rw-rw-
log.js
1.17
KB
-rw-rw-rw-
map.js
4.49
KB
-rw-rw-rw-
mapLimit.js
1.58
KB
-rw-rw-rw-
mapSeries.js
1.48
KB
-rw-rw-rw-
mapValues.js
4.48
KB
-rw-rw-rw-
mapValuesLimit.js
2.07
KB
-rw-rw-rw-
mapValuesSeries.js
1.35
KB
-rw-rw-rw-
memoize.js
3
KB
-rw-rw-rw-
nextTick.js
1.44
KB
-rw-rw-rw-
package.json
2.15
KB
-rw-rw-rw-
parallel.js
5.44
KB
-rw-rw-rw-
parallelLimit.js
1.48
KB
-rw-rw-rw-
priorityQueue.js
1.41
KB
-rw-rw-rw-
queue.js
626
B
-rw-rw-rw-
race.js
2.08
KB
-rw-rw-rw-
reduce.js
4.76
KB
-rw-rw-rw-
reduceRight.js
1.47
KB
-rw-rw-rw-
reflect.js
2.21
KB
-rw-rw-rw-
reflectAll.js
2.39
KB
-rw-rw-rw-
reject.js
2.61
KB
-rw-rw-rw-
rejectLimit.js
1.54
KB
-rw-rw-rw-
rejectSeries.js
1.44
KB
-rw-rw-rw-
retry.js
5.39
KB
-rw-rw-rw-
retryable.js
2.48
KB
-rw-rw-rw-
select.js
2.83
KB
-rw-rw-rw-
selectLimit.js
1.62
KB
-rw-rw-rw-
selectSeries.js
1.51
KB
-rw-rw-rw-
seq.js
2.59
KB
-rw-rw-rw-
series.js
5.69
KB
-rw-rw-rw-
setImmediate.js
1.36
KB
-rw-rw-rw-
some.js
3.71
KB
-rw-rw-rw-
someLimit.js
1.74
KB
-rw-rw-rw-
someSeries.js
1.64
KB
-rw-rw-rw-
sortBy.js
6.06
KB
-rw-rw-rw-
timeout.js
2.69
KB
-rw-rw-rw-
times.js
1.45
KB
-rw-rw-rw-
timesLimit.js
1.42
KB
-rw-rw-rw-
timesSeries.js
1.04
KB
-rw-rw-rw-
transform.js
5.43
KB
-rw-rw-rw-
tryEach.js
2.48
KB
-rw-rw-rw-
unmemoize.js
665
B
-rw-rw-rw-
until.js
2.03
KB
-rw-rw-rw-
waterfall.js
3.13
KB
-rw-rw-rw-
whilst.js
2.28
KB
-rw-rw-rw-
wrapSync.js
3.67
KB
-rw-rw-rw-
Delete
Unzip
Zip
${this.title}
Close
Code Editor : reduce.js
'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _eachOfSeries = require('./eachOfSeries.js'); var _eachOfSeries2 = _interopRequireDefault(_eachOfSeries); var _once = require('./internal/once.js'); var _once2 = _interopRequireDefault(_once); var _wrapAsync = require('./internal/wrapAsync.js'); var _wrapAsync2 = _interopRequireDefault(_wrapAsync); var _awaitify = require('./internal/awaitify.js'); var _awaitify2 = _interopRequireDefault(_awaitify); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /** * Reduces `coll` into a single value using an async `iteratee` to return each * successive step. `memo` is the initial state of the reduction. This function * only operates in series. * * For performance reasons, it may make sense to split a call to this function * into a parallel map, and then use the normal `Array.prototype.reduce` on the * results. This function is for situations where each step in the reduction * needs to be async; if you can get the data before reducing it, then it's * probably a good idea to do so. * * @name reduce * @static * @memberOf module:Collections * @method * @alias inject * @alias foldl * @category Collection * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. * @param {*} memo - The initial state of the reduction. * @param {AsyncFunction} iteratee - A function applied to each item in the * array to produce the next step in the reduction. * The `iteratee` should complete with the next state of the reduction. * If the iteratee completes with an error, the reduction is stopped and the * main `callback` is immediately called with the error. * Invoked with (memo, item, callback). * @param {Function} [callback] - A callback which is called after all the * `iteratee` functions have finished. Result is the reduced value. Invoked with * (err, result). * @returns {Promise} a promise, if no callback is passed * @example * * // file1.txt is a file that is 1000 bytes in size * // file2.txt is a file that is 2000 bytes in size * // file3.txt is a file that is 3000 bytes in size * // file4.txt does not exist * * const fileList = ['file1.txt','file2.txt','file3.txt']; * const withMissingFileList = ['file1.txt','file2.txt','file3.txt', 'file4.txt']; * * // asynchronous function that computes the file size in bytes * // file size is added to the memoized value, then returned * function getFileSizeInBytes(memo, file, callback) { * fs.stat(file, function(err, stat) { * if (err) { * return callback(err); * } * callback(null, memo + stat.size); * }); * } * * // Using callbacks * async.reduce(fileList, 0, getFileSizeInBytes, function(err, result) { * if (err) { * console.log(err); * } else { * console.log(result); * // 6000 * // which is the sum of the file sizes of the three files * } * }); * * // Error Handling * async.reduce(withMissingFileList, 0, getFileSizeInBytes, function(err, result) { * if (err) { * console.log(err); * // [ Error: ENOENT: no such file or directory ] * } else { * console.log(result); * } * }); * * // Using Promises * async.reduce(fileList, 0, getFileSizeInBytes) * .then( result => { * console.log(result); * // 6000 * // which is the sum of the file sizes of the three files * }).catch( err => { * console.log(err); * }); * * // Error Handling * async.reduce(withMissingFileList, 0, getFileSizeInBytes) * .then( result => { * console.log(result); * }).catch( err => { * console.log(err); * // [ Error: ENOENT: no such file or directory ] * }); * * // Using async/await * async () => { * try { * let result = await async.reduce(fileList, 0, getFileSizeInBytes); * console.log(result); * // 6000 * // which is the sum of the file sizes of the three files * } * catch (err) { * console.log(err); * } * } * * // Error Handling * async () => { * try { * let result = await async.reduce(withMissingFileList, 0, getFileSizeInBytes); * console.log(result); * } * catch (err) { * console.log(err); * // [ Error: ENOENT: no such file or directory ] * } * } * */ function reduce(coll, memo, iteratee, callback) { callback = (0, _once2.default)(callback); var _iteratee = (0, _wrapAsync2.default)(iteratee); return (0, _eachOfSeries2.default)(coll, (x, i, iterCb) => { _iteratee(memo, x, (err, v) => { memo = v; iterCb(err); }); }, err => callback(err, memo)); } exports.default = (0, _awaitify2.default)(reduce, 4); module.exports = exports.default;
Close