GT2/GT2-Android/node_modules/merge
Ren Ren Juan c5fd23b54f Get new tree with state verified with current React Native on both platforms 2018-02-12 17:11:06 +00:00
..
.npmignore Get new tree with state verified with current React Native on both platforms 2018-02-12 17:11:06 +00:00
LICENSE Get new tree with state verified with current React Native on both platforms 2018-02-12 17:11:06 +00:00
README.md Get new tree with state verified with current React Native on both platforms 2018-02-12 17:11:06 +00:00
bower.json Get new tree with state verified with current React Native on both platforms 2018-02-12 17:11:06 +00:00
merge.js Get new tree with state verified with current React Native on both platforms 2018-02-12 17:11:06 +00:00
merge.min.js Get new tree with state verified with current React Native on both platforms 2018-02-12 17:11:06 +00:00
package.json Get new tree with state verified with current React Native on both platforms 2018-02-12 17:11:06 +00:00

README.md

Merge

Merge multiple objects into one, optionally creating a new cloned object. Similar to the jQuery.extend but more flexible. Works in Node.js and the browser.

Node.js Usage

npm install merge --save
var merge = require('merge'), original, cloned;

console.log(merge({one:'hello'}, {two: 'world'}));
// -> {"one": "hello", "two": "world"}

original = { x: { y: 1 } };
cloned = merge(true, original);
cloned.x.y++;

console.log(original.x.y, cloned.x.y);
// -> 1, 2

console.log(merge.recursive(true, original, { x: { z: 2 } }));
// -> {"x": { "y": 1, "z": 2 } }

Browser Usage

<script src="http://files.yeikos.com/merge.js"></script>
<script>
	var original, cloned;

	console.log(merge({one:'hello'}, {two: 'world'}));
	// -> {"one": "hello", "two": "world"}

	original = { x: { y: 1 } };
	cloned = merge(true, original);
	cloned.x.y++;

	console.log(original.x.y, cloned.x.y);
	// -> 1, 2

	console.log(merge.recursive(true, original, { x: { z: 2 } }));
	// -> {"x": { "y": 1, "z": 2 } }

</script>

Tests

npm test