merge-both
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

Merge both Travis CI Build Status

Merge with support for objects and arrays.

NPM Badge

Install

npm install merge-both

Usage

const mergeBoth = require("merge-both");

mergeBoth(
    {
        a: ["a", "b"],
        b: { b: "c" },
        c: "e"
    },
    {
        a: ["c", "d"],
        b: { b: "f", c: "d" }
    }
);

// Returned object
{
    a: ["a", "b", "c", "d"],
    b: { b: "f", c: "d" },
    c: "e",
}

API

mergeBoth(obj, ...source)

obj

Type: object

The main object to merge.

source

Type: object

The other objects to merge.

Readme

Keywords

none

Package Sidebar

Install

npm i merge-both

Weekly Downloads

2

Version

1.0.1

License

MIT

Unpacked Size

3.45 kB

Total Files

6

Last publish

Collaborators

  • richienb