Firebase Update
This commit is contained in:
22
express-server/node_modules/split-array-stream/index.js
generated
vendored
Normal file
22
express-server/node_modules/split-array-stream/index.js
generated
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
'use strict';
|
||||
|
||||
var async = require('async');
|
||||
var ended = require('is-stream-ended');
|
||||
|
||||
module.exports = function (array, stream, callback) {
|
||||
var arr = [].slice.call(array);
|
||||
|
||||
async.whilst(
|
||||
function () {
|
||||
return !ended(stream) && arr.length > 0;
|
||||
},
|
||||
|
||||
function (next) {
|
||||
stream.push(arr.shift());
|
||||
setImmediate(next);
|
||||
},
|
||||
|
||||
function () {
|
||||
callback(ended(stream));
|
||||
});
|
||||
};
|
Reference in New Issue
Block a user