Socket
Socket
Sign inDemoInstall

object-diff-paths

Package Overview
Dependencies
0
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    object-diff-paths

Calculates a diff of two objects, and returns the different object paths


Version published
Weekly downloads
472
increased by0.64%
Maintainers
1
Install size
5.82 kB
Created
Weekly downloads
 

Readme

Source

object-diff-paths

Calculates a diff of 2 objects, and returns a list of the different object paths.

The object paths can then be used in lodash.get/lodash.set.

Installation

$ npm i object-diff-paths

Usage

const o1 = {
    a: {
        b: {
            c: { s: 't' },
        }
    }
};
const o2 = {...o1, a: {...o1.a, b: {...o1.a.b, d: 'e'}}};

const diff = objectDiff(o1, o2);

assert.deepEqual(diff, [
    'a.b.d'
]);

Keywords

FAQs

Last updated on 25 Aug 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc