Comparing version 1.0.2 to 1.0.3
12
bl.js
@@ -60,4 +60,10 @@ var DuplexStream = require('readable-stream/duplex') | ||
this._bufs.push(isBuffer ? buf : new Buffer(buf)) | ||
this.length += buf.length | ||
if (buf instanceof BufferList) { | ||
this._bufs.push.apply(this._bufs, buf._bufs) | ||
this.length += buf.length | ||
} else { | ||
this._bufs.push(isBuffer ? buf : new Buffer(buf)) | ||
this.length += buf.length | ||
} | ||
return this | ||
@@ -166,3 +172,3 @@ } | ||
while (this._bufs.length) { | ||
if (bytes > this._bufs[0].length) { | ||
if (bytes >= this._bufs[0].length) { | ||
bytes -= this._bufs[0].length | ||
@@ -169,0 +175,0 @@ this.length -= this._bufs[0].length |
{ | ||
"name": "bl", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "Buffer List: collect buffers and access with a standard readable Buffer interface, streamable too!", | ||
@@ -30,6 +30,6 @@ "main": "bl.js", | ||
"devDependencies": { | ||
"tape": "~2.12.3", | ||
"faucet": "0.0.1", | ||
"hash_file": "~0.1.1", | ||
"faucet": "~0.0.1" | ||
"tape": "~4.4.0" | ||
} | ||
} |
@@ -131,2 +131,16 @@ var tape = require('tape') | ||
tape('complete consumption', function (t) { | ||
var bl = new BufferList() | ||
bl.append(new Buffer('a')) | ||
bl.append(new Buffer('b')) | ||
bl.consume(2) | ||
t.equal(bl.length, 0) | ||
t.equal(bl._bufs.length, 0) | ||
t.end() | ||
}) | ||
tape('test readUInt8 / readInt8', function (t) { | ||
@@ -133,0 +147,0 @@ var buf1 = new Buffer(1) |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
32077
633
0