Repositorio del curso CCOM4030 el semestre B91 del proyecto Artesanías con el Instituto de Cultura

readable_serial_ordered.js 941B

1234567891011121314151617181920212223242526272829
  1. var serialOrdered = require('../serialOrdered.js');
  2. // API
  3. module.exports = ReadableSerialOrdered;
  4. // expose sort helpers
  5. module.exports.ascending = serialOrdered.ascending;
  6. module.exports.descending = serialOrdered.descending;
  7. /**
  8. * Streaming wrapper to `asynckit.serialOrdered`
  9. *
  10. * @param {array|object} list - array or object (named list) to iterate over
  11. * @param {function} iterator - iterator to run
  12. * @param {function} sortMethod - custom sort function
  13. * @param {function} callback - invoked when all elements processed
  14. * @returns {stream.Readable#}
  15. */
  16. function ReadableSerialOrdered(list, iterator, sortMethod, callback)
  17. {
  18. if (!(this instanceof ReadableSerialOrdered))
  19. {
  20. return new ReadableSerialOrdered(list, iterator, sortMethod, callback);
  21. }
  22. // turn on object mode
  23. ReadableSerialOrdered.super_.call(this, {objectMode: true});
  24. this._start(serialOrdered, list, iterator, sortMethod, callback);
  25. }