Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

buffers

Package Overview
Dependencies
Maintainers
0
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

buffers - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

24

index.js

@@ -12,19 +12,29 @@ module.exports = Buffers;

Buffers.prototype.push = function () {
var res = this.buffers.push.apply(this.buffers, arguments);
for (var i = 0; i < arguments.length; i++) {
var buf = arguments[i];
if (!Buffer.isBuffer(buf)) {
if (!Buffer.isBuffer(arguments[i])) {
throw new TypeError('Tried to push a non-buffer');
}
}
for (var i = 0; i < arguments.length; i++) {
var buf = arguments[i];
this.buffers.push(buf);
this.length += buf.length;
}
return res;
return this.length;
};
Buffers.prototype.unshift = function () {
var res = this.buffers.unshift.apply(this.buffers, arguments);
for (var i = 0; i < arguments.length; i++) {
this.length += arguments[i].length;
if (!Buffer.isBuffer(arguments[i])) {
throw new TypeError('Tried to unshift a non-buffer');
}
}
return res;
for (var i = 0; i < arguments.length; i++) {
var buf = arguments[i];
this.buffers.unshift(buf);
this.length += buf.length;
}
return this.length;
};

@@ -31,0 +41,0 @@

{
"name" : "buffers",
"description" : "Treat a collection of Buffers as a single contiguous partially mutable Buffer.",
"version" : "0.0.3",
"version" : "0.0.4",
"repository" : "http://github.com/substack/node-buffers.git",

@@ -6,0 +6,0 @@ "author" : "James Halliday <mail@substack.net> (http://substack.net)",

@@ -142,2 +142,7 @@ var assert = require('assert');

);
assert.throws(function () {
bufs.push(new Buffer([11,12]), 'moo');
});
assert.eql(bufs.buffers.length, 4);
};

@@ -155,2 +160,6 @@

);
assert.throws(function () {
bufs.unshift(new Buffer([-2,-1]), 'moo');
});
assert.eql(bufs.buffers.length, 4);
};

@@ -157,0 +166,0 @@

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc