Comparing version 0.3.0 to 0.4.0
@@ -37,3 +37,3 @@ const DuplexStream = require('readable-stream/duplex') | ||
BufferList.prototype.append = function (buf) { | ||
this._bufs.push(buf) | ||
this._bufs.push(Buffer.isBuffer(buf) ? buf : new Buffer(buf)) | ||
this.length += buf.length | ||
@@ -40,0 +40,0 @@ return this |
{ | ||
"name" : "bl" | ||
, "version" : "0.3.0" | ||
, "version" : "0.4.0" | ||
, "description" : "Buffer List: collect buffers and access with a standard readable Buffer interface, streamable too!" | ||
@@ -5,0 +5,0 @@ , "main" : "bl.js" |
@@ -17,3 +17,3 @@ # bl *(BufferList)* | ||
bl.append(new Buffer('efg')) | ||
bl.append(new Buffer('hi')) | ||
bl.append('hi') // bl will also accept & convert Strings | ||
bl.append(new Buffer('j')) | ||
@@ -20,0 +20,0 @@ bl.append(new Buffer([ 0x3, 0x4 ])) |
18
test.js
@@ -303,1 +303,19 @@ const tape = require('tape') | ||
tape('test String appendage', function (t) { | ||
var bl = new BufferList() | ||
, b = new Buffer('abcdefghij\xff\x00') | ||
bl.append('abcd') | ||
bl.append('efg') | ||
bl.append('hi') | ||
bl.append('j') | ||
bl.append('\xff\x00') | ||
'hex utf8 utf-8 ascii binary base64 ucs2 ucs-2 utf16le utf-16le' | ||
.split(' ') | ||
.forEach(function (enc) { | ||
t.equal(bl.toString(enc), b.toString(enc)) | ||
}) | ||
t.end() | ||
}) |
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
23834
384