1.0.1 • Published 5 years ago

merge-both v1.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

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.

1.0.1

5 years ago

1.0.0

5 years ago