Skip to content

smiranton-ua/deep-merge-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

deep-merge-js

Plain javascript function to deeply merge objects

Bundle is 1.4Kb -> gzipped: 682B

Getting Started

Example Usage

const merge = require('deep-merge-js')

const obj1 = {
  foo: 1,
  bar: [1, 2, 3]
}

const obj2 = {
  foo: 2,
  baz: {
    test: [1, 2, 3]
  }
}


merge(obj1, obj2);

/*
  Output will be
  {
    foo: 1,
    bar: [1, 2, 3],
    baz: {
      test: [1, 2, 3]
    }
  }
*/

Installation

With npm do:

npm install deep-merge-js

Include

const merge = require('deep-merge-js')

Testing

With npm do:

npm test

About

Deep merge utility

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •