Socket
Socket
Sign inDemoInstall

bl

Package Overview
Dependencies
5
Maintainers
1
Versions
61
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.8.2 to 0.9.0

npm-shrinkwrap.json

5

bl.js

@@ -52,3 +52,6 @@ var DuplexStream = require('readable-stream').Duplex

BufferList.prototype.append = function (buf) {
this._bufs.push(Buffer.isBuffer(buf) ? buf : new Buffer(buf))
var isBuffer = Buffer.isBuffer(buf) ||
buf instanceof BufferList
this._bufs.push(isBuffer ? buf : new Buffer(buf))
this.length += buf.length

@@ -55,0 +58,0 @@ return this

2

package.json
{
"name": "bl",
"version": "0.8.2",
"version": "0.9.0",
"description": "Buffer List: collect buffers and access with a standard readable Buffer interface, streamable too!",

@@ -5,0 +5,0 @@ "main": "bl.js",

@@ -124,3 +124,3 @@ # bl *(BufferList)*

### bl.append(buffer)
`append(buffer)` adds an additional buffer to the internal list.
`append(buffer)` adds an additional buffer or BufferList to the internal list.

@@ -127,0 +127,0 @@ --------------------------------------------------------

@@ -79,2 +79,19 @@ var tape = require('tape')

tape('multiple bytes from multiple buffer lists', function (t) {
var bl = new BufferList()
bl.append(new BufferList([new Buffer('abcd'), new Buffer('efg')]))
bl.append(new BufferList([new Buffer('hi'), new Buffer('j')]))
t.equal(bl.length, 10)
t.equal(bl.slice(0, 10).toString('ascii'), 'abcdefghij')
t.equal(bl.slice(3, 10).toString('ascii'), 'defghij')
t.equal(bl.slice(3, 6).toString('ascii'), 'def')
t.equal(bl.slice(3, 8).toString('ascii'), 'defgh')
t.equal(bl.slice(5, 10).toString('ascii'), 'fghij')
t.end()
})
tape('consuming from multiple buffers', function (t) {

@@ -81,0 +98,0 @@ var bl = new BufferList()

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc