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

json-buffer

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

json-buffer - npm Package Compare versions

Comparing version 3.0.0 to 3.0.1

2

index.js

@@ -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: {

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