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

@broofa/jsondiff

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@broofa/jsondiff - npm Package Compare versions

Comparing version 1.3.3 to 1.3.4

2

index.js

@@ -34,4 +34,2 @@ // Reserved values

case 'Boolean':
return after;
case 'Number':

@@ -38,0 +36,0 @@ case 'String':

2

package.json
{
"name": "@broofa/jsondiff",
"version": "1.3.3",
"version": "1.3.4",
"description": "Pragmatic, intuitive diffing and patching of JSON objects",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -29,5 +29,7 @@ <!--

⇒ { name: 'my object',
⇒ description: 'it\'s an object!',
⇒ details: { it: 'has', an: 'array', with: [ 'a', 'few', 'elements' ] } }
⇒ {
⇒ name: 'my object',
⇒ description: "it's an object!",
⇒ details: { it: 'has', an: 'array', with: [ 'a', 'few', 'elements' ] }
⇒ }
```

@@ -38,8 +40,11 @@

⇒ { name: 'updated object',
⇒ title: 'it\'s an object!',
⇒ details:
⇒ { it: 'has',
⇒ an: 'array',
⇒ with: [ 'a', 'few', 'more', 'elements', { than: 'before' } ] } }
⇒ {
⇒ name: 'updated object',
⇒ title: "it's an object!",
⇒ details: {
⇒ it: 'has',
⇒ an: 'array',
⇒ with: [ 'a', 'few', 'more', 'elements', { than: 'before' } ]
⇒ }
⇒ }
```

@@ -52,7 +57,8 @@

⇒ { name: 'updated object',
⇒ {
⇒ name: 'updated object',
⇒ description: '-',
⇒ details:
⇒ { with: [ '+', '+', 'more', 'elements', { than: 'before' } ] },
⇒ title: 'it\'s an object!' }
⇒ details: { with: [ '+', '+', 'more', 'elements', { than: 'before' } ] },
⇒ title: "it's an object!"
⇒ }
```

@@ -66,8 +72,11 @@ *(Note the special DROP and KEEP values ("-" and "+")! These are explained in **Patch Objects**, below.)*

⇒ { name: 'updated object',
⇒ details:
⇒ { it: 'has',
⇒ an: 'array',
⇒ with: [ 'a', 'few', 'more', 'elements', { than: 'before' } ] },
⇒ title: 'it\'s an object!' }
⇒ {
⇒ name: 'updated object',
⇒ details: {
⇒ it: 'has',
⇒ an: 'array',
⇒ with: [ 'a', 'few', 'more', 'elements', { than: 'before' } ]
⇒ },
⇒ title: "it's an object!"
⇒ }
```

@@ -86,20 +95,30 @@

⇒ [ { kind: 'E',
⇒ [
⇒ {
⇒ kind: 'E',
⇒ path: [ 'name' ],
⇒ lhs: 'my object',
⇒ rhs: 'updated object' },
⇒ { kind: 'D', path: [ 'description' ], lhs: 'it\'s an object!' },
⇒ { kind: 'A',
⇒ rhs: 'updated object'
⇒ },
⇒ { kind: 'D', path: [ 'description' ], lhs: "it's an object!" },
⇒ {
⇒ kind: 'A',
⇒ path: [ 'details', 'with' ],
⇒ index: 4,
⇒ item: { kind: 'N', rhs: [ [Function: Object] ] } },
⇒ { kind: 'A',
⇒ item: { kind: 'N', rhs: [ [Function: Object] ] }
⇒ },
⇒ {
⇒ kind: 'A',
⇒ path: [ 'details', 'with' ],
⇒ index: 3,
⇒ item: { kind: 'N', rhs: 'elements' } },
⇒ { kind: 'E',
⇒ item: { kind: 'N', rhs: 'elements' }
⇒ },
⇒ {
⇒ kind: 'E',
⇒ path: [ 'details', 'with', 2 ],
⇒ lhs: 'elements',
⇒ rhs: 'more' },
⇒ { kind: 'N', path: [ 'title' ], rhs: 'it\'s an object!' } ]
⇒ rhs: 'more'
⇒ },
⇒ { kind: 'N', path: [ 'title' ], rhs: "it's an object!" }
⇒ ]
```

@@ -112,7 +131,9 @@

⇒ [ { op: 'remove', path: '/description' },
⇒ { op: 'add', path: '/title', value: 'it\'s an object!' },
⇒ [
⇒ { op: 'remove', path: '/description' },
⇒ { op: 'add', path: '/title', value: "it's an object!" },
⇒ { op: 'replace', path: '/name', value: 'updated object' },
⇒ { op: 'add', path: '/details/with/2', value: 'more' },
⇒ { op: 'add', path: '/details/with/-', value: { than: 'before' } } ]
⇒ { op: 'add', path: '/details/with/-', value: { than: 'before' } }
⇒ ]
```

@@ -119,0 +140,0 @@

@@ -17,4 +17,6 @@ var assert = require('assert');

it('Boolean', async () => {
assert.equal(true, diff(true, true));
assert.equal(KEEP, diff(true, true));
assert.equal(KEEP, diff(false, false));
assert.equal(false, diff(true, false));
assert.equal(true, diff(false, true));
});

@@ -21,0 +23,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