json-buffer
Advanced tools
Comparing version 3.0.0 to 3.0.1
@@ -52,3 +52,3 @@ //TODO: handle reviver/dehydrate function like normal | ||
if(/^:base64:/.test(value)) | ||
return new Buffer(value.substring(8), 'base64') | ||
return Buffer.from(value.substring(8), 'base64') | ||
else | ||
@@ -55,0 +55,0 @@ return /^:/.test(value) ? value.substring(1) : value |
{ | ||
"name": "json-buffer", | ||
"description": "JSON parse & stringify that supports binary via bops & base64", | ||
"version": "3.0.0", | ||
"version": "3.0.1", | ||
"homepage": "https://github.com/dominictarr/json-buffer", | ||
@@ -6,0 +6,0 @@ "repository": { |
@@ -17,3 +17,3 @@ # json-buffer | ||
var str = JSONB.stringify(new Buffer('hello there!')) | ||
var str = JSONB.stringify(Buffer.from('hello there!')) | ||
@@ -20,0 +20,0 @@ console.log(JSONB.parse(str)) //GET a BUFFER back |
@@ -10,4 +10,4 @@ | ||
var examples = { | ||
simple: { foo: [], bar: {}, baz: new Buffer('some binary data') }, | ||
just_buffer: new Buffer('JUST A BUFFER'), | ||
simple: { foo: [], bar: {}, baz: Buffer.from('some binary data') }, | ||
just_buffer: Buffer.from('JUST A BUFFER'), | ||
all_types: { | ||
@@ -22,11 +22,11 @@ string:'hello', | ||
}, | ||
foo: new Buffer('foo'), | ||
foo2: new Buffer('foo2'), | ||
foo: Buffer.from('foo'), | ||
foo2: Buffer.from('foo2'), | ||
escape: { | ||
buffer: new Buffer('x'), | ||
string: _JSON.stringify(new Buffer('x')) | ||
buffer: Buffer.from('x'), | ||
string: _JSON.stringify(Buffer.from('x')) | ||
}, | ||
escape2: { | ||
buffer: new Buffer('x'), | ||
string: ':base64:'+ new Buffer('x').toString('base64') | ||
buffer: Buffer.from('x'), | ||
string: ':base64:'+ Buffer.from('x').toString('base64') | ||
}, | ||
@@ -33,0 +33,0 @@ undefined: { |
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
5404
6