Skip to content
 
 

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

compare-obj

Recursively compare 2 objects on a property bases to get the difference



Built with ❤︎ by Tiaan and contributors

Table of Contents

Table of Contents
  • About
  • Install
  • Usage
  • Contribute
  • License
  • Install

    $ npm install --save compare-obj
    # OR
    $ yarn add compare-obj

    Usage

    const compareObj = require('compare-obj')
    
    const obj1 = {
    	foo: 5,
    	bar: 9,
    	baz: {
    		goo: 6,
    		foo: {
    			hello: 'world'
    		}
    	}
    }
    
    const obj2 = {
    	foo: 5,
    	baz: {
    		goo: 6
    	}
    }
    
    console.log(compareObj(obj1, obj2))
    // ​​​​​{ bar: 9, baz: { foo: { hello: 'world' } } }​​​​​

    Contribute

    Contributions are welcome. Please open up an issue or create PR if you would like to help out.

    Note: If editing the README, please conform to the standard-readme specification.

    License

    Licensed under the MIT License.

    About

    Recursively compare 2 objects on a property bases to get the difference

    Resources

    Stars

    0 stars

    Watchers

    1 watching

    Forks

    Releases

    Packages

    Contributors

    Languages