JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 21262415
  • Score
    100M100P100Q216352F

Recursive object extending.

Package Exports

  • deep-extend

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (deep-extend) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Node.JS module "Deep Extend"

Recursive object extending.

Version

0.2.1

Install

npm install deep-extend

Usage

var deepExtend = require('deep-extend'),
    obj1 = {
        a: 1,
        b: 2,
        d: {
            a: 1,
            b: [],
            c: {test1: 123, test2: 321}
        },
        f: 5
    },
    obj2 = {
        b: 3,
        c: 5,
        d: {
            b: {first: 'one', second: 'two'},
            c: {test2: 222}
        },
        e: {one: 1, two: 2},
        f: []
    };

deepExtend(obj1, obj2);

console.log(obj1);
/*
    {
        a: 1,
        b: 3,
        d: {
            a: 1,
            b: {first: 'one', second: 'two'},
            c: {test1: 123, test2: 222} 
        },
        f: [],
        c: 5,
        e: {one: 1, two: 2}
    }
*/