Skip to content

yiwn/merge

Repository files navigation

merge

Copy enumerable properties of source to target object.

Installation

Using component

$ component install yiwn/merge

Using npm for browserify

$ npm install yiwn-merge

Usage

Example:

var merge = require('yiwn-merge');

var obj1, obj2;

obj1 = { a: 1, b: null };
obj2 = { c: 3, b: 2 };

merge(obj1, obj2); // -> { a: 1, b: null, c: 3 }
merge(obj1, obj2, true); // -> { a: 1, b: 2, c: 3 }

Test

Run tests with mocha

$ make test

License

The MIT License

About

Copy enumerable properties of source to target object.

Resources

License

Stars

Watchers

Forks

Packages

No packages published