@amphibian/extend

1.1.16 • Public • Published

extend

build status

extends a parent object while letting keys from child overwrite it

npm install @amphibian/extend
var extend = require('@amphibian/extend');

var parent = {
    obj: {
        foo: 'bar',
        bar: 'foo'
    },
    obj2: {
        foo: 'bar',
        bar: 'foo'
    },
    arr: [0, 1, 2, 3]
};

var child = {
    obj: {
        foo: 'overwrite'
    },
    obj2: false,
    arr: ['hello']
};

// Extend parent object
extend(parent, child); // > {obj: {foo: 'overwrite', bar: 'foo'}, obj2: false, arr: ['hello']}

Readme

Keywords

none

Package Sidebar

Install

npm i @amphibian/extend

Weekly Downloads

3

Version

1.1.16

License

ISC

Last publish

Collaborators

  • thomaslindstr_m