stream-array
Advanced tools
Comparing version 0.1.3 to 1.0.0
@@ -25,3 +25,3 @@ var Readable = require('stream').Readable | ||
StreamArray.prototype._read = function(size) { | ||
this.push(this._queue.shift()); | ||
this.push(this._queue.length ? this._queue.shift() : null); | ||
}; | ||
@@ -28,0 +28,0 @@ |
{ | ||
"name": "stream-array", | ||
"version": "0.1.3", | ||
"version": "1.0.0", | ||
"description": "Pipe an Array through Node.js streams", | ||
@@ -11,3 +11,3 @@ "dependencies": { | ||
"tap": "~0.4.0", | ||
"concat-stream": "~1.0.0" | ||
"concat-stream": "~1.4.0" | ||
}, | ||
@@ -14,0 +14,0 @@ "scripts": { |
@@ -6,3 +6,3 @@ # stream-array | ||
[![build status][1]][2] [![npm version][3]][4] [![dependencies][5]][6] | ||
[![build status][1]][2] [![npm version][3]][4] [![dependencies][5]][6] [![devDependencies][7]][8] | ||
@@ -39,2 +39,4 @@ | ||
[6]: https://david-dm.org/mimetnet/node-stream-array | ||
[7]: https://david-dm.org/mimetnet/node-stream-array/dev-status.png?#info=devDependencies | ||
[8]: https://david-dm.org/mimetnet/node-stream-array/#info=devDependencies | ||
var test = require('tap').test | ||
, Queue = require('fastqueue'); | ||
, Queue = require('fastqueue') | ||
; | ||
@@ -30,3 +30,5 @@ | ||
t.equal(undefined, q.shift(), 'empty shift === undefined'); | ||
t.end(); | ||
}); |
@@ -7,2 +7,13 @@ var tap = require('tap') | ||
test('empty array', function(t) { | ||
var s = streamify([]); | ||
s.pipe(concat({encoding: 'object'}, function(res) { | ||
t.equal(1, arguments.length, 'concat returns 1 arg'); | ||
t.equal(0, res.length, 'result is an empty list'); | ||
t.deepEqual([], res, 'result matches expectation'); | ||
t.end(); | ||
})); | ||
}); | ||
test('array of strings', function(t) { | ||
@@ -9,0 +20,0 @@ var s = streamify(['1', '2', '3', 'Four']); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
6460
102
1
41