🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

object-diff-paths

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

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

1.0.5
latest
Source
npm
Version published
Maintainers
1
Created
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

object diff

FAQs

Package last updated on 25 Aug 2020

Did you know?

Socket

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