Last change
on this file since 6a80231 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
610 bytes
|
Rev | Line | |
---|
[6a3a178] | 1 | var utils = require('../utils');
|
---|
| 2 |
|
---|
| 3 | /**
|
---|
| 4 | * Merge the object `dest` with the given args.
|
---|
| 5 | *
|
---|
| 6 | * @param {Object} dest
|
---|
| 7 | * @param {Object} ...
|
---|
| 8 | * @return {Object} dest
|
---|
| 9 | * @api public
|
---|
| 10 | */
|
---|
| 11 |
|
---|
| 12 | (module.exports = function merge(dest){
|
---|
| 13 | utils.assertPresent(dest, 'dest');
|
---|
| 14 | dest = utils.unwrap(dest).first;
|
---|
| 15 | utils.assertType(dest, 'object', 'dest');
|
---|
| 16 |
|
---|
| 17 | var last = utils.unwrap(arguments[arguments.length - 1]).first
|
---|
| 18 | , deep = (true === last.val);
|
---|
| 19 |
|
---|
| 20 | for (var i = 1, len = arguments.length - deep; i < len; ++i) {
|
---|
| 21 | utils.merge(dest.vals, utils.unwrap(arguments[i]).first.vals, deep);
|
---|
| 22 | }
|
---|
| 23 | return dest;
|
---|
| 24 | }).raw = true;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.