Current Path: > > lib > node_modules > npm > node_modules > asynckit > > lib
Operation : Linux premium131.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64 Software : Apache Server IP : 162.0.232.56 | Your IP: 216.73.216.111 Domains : 1034 Domain(s) Permission : [ 0755 ]
Name | Type | Size | Last Modified | Actions |
---|---|---|---|---|
abort.js | File | 497 bytes | March 10 2021 14:36:40. | |
async.js | File | 599 bytes | March 10 2021 14:36:40. | |
defer.js | File | 441 bytes | March 10 2021 14:36:40. | |
iterate.js | File | 1794 bytes | March 10 2021 14:36:40. | |
readable_asynckit.js | File | 1611 bytes | March 10 2021 14:36:40. | |
readable_parallel.js | File | 673 bytes | March 10 2021 14:36:40. | |
readable_serial.js | File | 655 bytes | March 10 2021 14:36:40. | |
readable_serial_ordered.js | File | 941 bytes | March 10 2021 14:36:40. | |
state.js | File | 941 bytes | March 10 2021 14:36:40. | |
streamify.js | File | 2964 bytes | March 10 2021 14:36:40. | |
terminator.js | File | 533 bytes | March 10 2021 14:36:40. |
var async = require('./async.js') , abort = require('./abort.js') ; // API module.exports = iterate; /** * Iterates over each job object * * @param {array|object} list - array or object (named list) to iterate over * @param {function} iterator - iterator to run * @param {object} state - current job status * @param {function} callback - invoked when all elements processed */ function iterate(list, iterator, state, callback) { // store current index var key = state['keyedList'] ? state['keyedList'][state.index] : state.index; state.jobs[key] = runJob(iterator, key, list[key], function(error, output) { // don't repeat yourself // skip secondary callbacks if (!(key in state.jobs)) { return; } // clean up jobs delete state.jobs[key]; if (error) { // don't process rest of the results // stop still active jobs // and reset the list abort(state); } else { state.results[key] = output; } // return salvaged results callback(error, state.results); }); } /** * Runs iterator over provided job element * * @param {function} iterator - iterator to invoke * @param {string|number} key - key/index of the element in the list of jobs * @param {mixed} item - job description * @param {function} callback - invoked after iterator is done with the job * @returns {function|mixed} - job abort function or something else */ function runJob(iterator, key, item, callback) { var aborter; // allow shortcut if iterator expects only two arguments if (iterator.length == 2) { aborter = iterator(item, async(callback)); } // otherwise go with full three arguments else { aborter = iterator(item, key, async(callback)); } return aborter; }
SILENT KILLER Tool