flat-merge-n
v1.0.1
Published
A simple shallow merge utility. Takes n values, returns the merged result.
Downloads
327
Maintainers
Readme
flat-merge-n
A simple shallow merge utility. Takes n values, returns the merged result.
- Does not modify the original values.
- Only merges own properties.
- Does not clone values.
- Always returns an object.
Usage
var merge = require('flat-merge-n');
var a = {
foo: 'stuff',
bar: 2,
baz: true
};
var b = {
whatsits: 'majigger',
baz: false
};
var c = {
whatsits: 'meh',
beep: 'boop'
};
var result = merge(a,b,c);
->
result == {
foo: 'stuff',
bar: 2,
baz: false,
whatsits: 'meh',
beep: 'boop'
}