serial.js 501 B

123456789101112131415161718
  1. var serialOrdered = require('./serialOrdered.js');
  2. // Public API
  3. module.exports = serial;
  4. /**
  5. * Runs iterator over provided array elements in series
  6. *
  7. * @param {array|object} list - array or object (named list) to iterate over
  8. * @param {function} iterator - iterator to run
  9. * @param {function} callback - invoked when all elements processed
  10. * @returns {function} - jobs terminator
  11. */
  12. function serial(list, iterator, callback)
  13. {
  14. return serialOrdered(list, iterator, null, callback);
  15. }