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

readable_serial.js 655B

12345678910111213141516171819202122232425
  1. var serial = require('../serial.js');
  2. // API
  3. module.exports = ReadableSerial;
  4. /**
  5. * Streaming wrapper to `asynckit.serial`
  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 {stream.Readable#}
  11. */
  12. function ReadableSerial(list, iterator, callback)
  13. {
  14. if (!(this instanceof ReadableSerial))
  15. {
  16. return new ReadableSerial(list, iterator, callback);
  17. }
  18. // turn on object mode
  19. ReadableSerial.super_.call(this, {objectMode: true});
  20. this._start(serial, list, iterator, callback);
  21. }