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

iobuffer

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

iobuffer - npm Package Compare versions

Comparing version 2.0.0 to 2.1.0

16

IOBuffer.js

@@ -7,4 +7,4 @@ 'use strict';

class IOBuffer {
constructor(data) {
let length = 0;
constructor(data, options) {
options = options || {};
if (data === undefined) {

@@ -14,10 +14,12 @@ data = defaultByteLength;

if (typeof data === 'number') {
length = data;
data = new ArrayBuffer(data);
}
length = data.byteLength;
let length = data.byteLength;
const offset = options.offset ? options.offset>>>0 : 0;
if (data.buffer) {
length = data.byteLength;
length = data.byteLength - offset;
if (data.byteLength !== data.buffer.byteLength) { // Node.js buffer from pool
data = data.buffer.slice(data.byteOffset, data.byteOffset + data.byteLength);
data = data.buffer.slice(data.byteOffset + offset, data.byteOffset + data.byteLength);
} else if (offset) {
data = data.buffer.slice(offset);
} else {

@@ -29,2 +31,4 @@ data = data.buffer;

this.length = length;
this.byteLength = length;
this.byteOffset = 0;
this.offset = 0;

@@ -31,0 +35,0 @@ this.littleEndian = true;

{
"name": "iobuffer",
"version": "2.0.0",
"version": "2.1.0",
"description": "Read and write binary data on ArrayBuffers",

@@ -11,4 +11,4 @@ "main": "./IOBuffer.js",

"test": "mocha --require should --reporter mocha-better-spec-reporter --recursive",
"test-cov": "babel-istanbul cover node_modules/.bin/_mocha -- --require should --reporter dot --recursive",
"test-travis": "babel-istanbul cover node_modules/.bin/_mocha --report lcovonly -- --require should --reporter mocha-better-spec-reporter --recursive"
"test-cov": "istanbul cover node_modules/.bin/_mocha -- --require should --reporter dot --recursive",
"test-travis": "istanbul cover node_modules/.bin/_mocha --report lcovonly -- --require should --reporter mocha-better-spec-reporter --recursive"
},

@@ -26,7 +26,7 @@ "repository": {

"devDependencies": {
"babel-istanbul": "^0.4.0",
"mocha": "^2.3.3",
"istanbul": "^0.4.5",
"mocha": "^3.0.2",
"mocha-better-spec-reporter": "^3.0.0",
"should": "^7.1.0"
"should": "^11.1.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