Grunt Mocha Test Coverage
extend() objects for Node.js
extend-fn is self written method to extend json objects recursively.
These objects can also have functions as properties.
The implementation of this extend method is due to a personal use in a project i am working on. All other extend modules found in npm could not extend an object with other that has functions as properties.
Installation
This package is availabe on npm as: extend-fn
npm install extend-fn
Usage
Syntax: extend ( to_extend
, object1
, [objectN
] )
Extend one object with one or more other objects, returning the result object.
Example:
var extend = ;var result = ;
Keep in mind that the final result is the object, that will be returned from extend().
Arguments
to_extend
Object The object to extend.object1
Object The object that will be merged into the first.objectN
Object (Optional) More objects to merge into the first.
Example
var extend = ; var to = { return true; }; var obj1 = { return false; } property_y: { return true; } ; var obj2 = { return "hello world"; } property_z: 1; var obj3 = { return "i am final"; } property_z: 2 property_y: { return false; } j: 23 property_w: 'i am a word'; var expected = { return "i am final"; } property_y: { return false; } j: 23 property_z: 2 property_w: 'i am a word'; var result = ; // result is deep equal to expected
License
extend-fn
is licensed under the MIT License.