Comparing version 1.4.0 to 1.5.0
10
index.js
@@ -105,3 +105,3 @@ var varint = require('varint') | ||
function decode_array (buffer, start, length) { | ||
var a = [], i = 0 | ||
var a = [] | ||
for(var c = 0; c < length;) { | ||
@@ -123,9 +123,7 @@ var tag = varint.decode(buffer, start+c) | ||
var tag = varint.decode(buffer, start+c) | ||
var type = tag & TAG_MASK | ||
// JavaScript only allows string-valued and Symbol keys for objects | ||
if(tag & TAG_MASK) throw new Error('required type:string') | ||
var len = tag >> TAG_SIZE | ||
c += varint.decode.bytes | ||
//TODO: positive integers keys are always in order! | ||
//floats or negative numbers encoded as strings. or may not be keys? | ||
if(type === 7) throw new Error('reserved type:key') | ||
var key = decode_type(type, buffer, start+c, len) | ||
var key = decode_string(buffer, start+c, len) | ||
c += len | ||
@@ -132,0 +130,0 @@ |
{ | ||
"name": "bipf", | ||
"description": "binary in-place format", | ||
"version": "1.4.0", | ||
"homepage": "https://github.com/dominictarr/binary", | ||
"version": "1.5.0", | ||
"homepage": "https://github.com/ssbc/bipf", | ||
"repository": { | ||
"type": "git", | ||
"url": "git://github.com/dominictarr/binary.git" | ||
"url": "git://github.com/ssbc/bipf.git" | ||
}, | ||
@@ -10,0 +10,0 @@ "dependencies": { |
@@ -92,6 +92,6 @@ var binary = require('../') | ||
test({foo: true}) | ||
test([-1, {foo: true}, new Buffer('deadbeef', 'hex')]) | ||
test([-1, {foo: true}, Buffer.from('deadbeef', 'hex')]) | ||
test(pkg) | ||
test({1: true}) | ||
tape('seekPath', function (t) { | ||
@@ -98,0 +98,0 @@ var path = ['dependencies', 'varint'] |
@@ -15,3 +15,3 @@ var binary = require('../') | ||
var json = JSON.stringify(value) | ||
var buffer = new Buffer(JSON.stringify(value)) | ||
var buffer = Buffer.from(JSON.stringify(value)) | ||
var N = 100000 | ||
@@ -75,4 +75,4 @@ | ||
start = Date.now() | ||
var dependencies = new Buffer('dependencies') | ||
var varint = new Buffer('varint') | ||
var dependencies = Buffer.from('dependencies') | ||
var varint = Buffer.from('varint') | ||
for(var i = 0; i < N; i++) { | ||
@@ -79,0 +79,0 @@ var c, d |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
33796
10
734