Skip to content

micnews/dedupe-objects

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dedupe-objects Build Status

Given two objects, reuse common objects between the both objects

Installation

Download node at nodejs.org and install it, if you haven't already.

npm install dedupe-objects --save

Usage

import dedupe from 'dedupe-objects';

const from = { beep: { boop: true }, foo: { bar: false } };
const to = { beep: { hello: 'world' }, foo: { bar: false } };
const result = dedupe(from, to);

// will be true since from.foo is deep equal to to.foo
console.log(from.foo === result.foo);
// will be an object { hello: 'world' }
console.log(result.beep);

Tests

npm install
npm test

Dependencies

  • dift: Super fast list diff algorithm
  • immutable-array-methods: Immutable versions of normally mutable array methods, such as pop(), push(), splice()
  • immutable-object-methods: Update normal plain javascript object, immutable style. Simlar to how immutable.js, seamless-immutable etc does it but a lot smaller and simpler.

Dev Dependencies

  • ava: Futuristic test runner 🚀
  • babel-cli: Babel command line.
  • babel-core: Babel compiler core.
  • babel-preset-es2015: Babel preset for all es2015 plugins.
  • nyc: the Istanbul command line interface
  • package-json-to-readme: Generate a README.md from package.json contents
  • semistandard: All the goodness of feross/standard with semicolons sprinkled on top.
  • snazzy: Format JavaScript Standard Style as Stylish (i.e. snazzy) output

License

MIT

Generated by package-json-to-readme

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •