"Fossies" - the Fresh Open Source Software Archive

Member "Atom/resources/app/apm/node_modules/asynckit/lib/readable_serial_ordered.js" (11 Apr 2017, 941 Bytes) of package /windows/misc/atom-windows.zip:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Javascript source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

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