This repository has been archived on 2024-07-27. You can view files and clone it, but cannot push or open issues or pull requests.
keksAccountGUI/node_modulesOLD/stylus/lib/functions/merge.js

25 lines
610 B
JavaScript
Raw Normal View History

2019-08-11 18:48:02 +00:00
var utils = require('../utils');
/**
* Merge the object `dest` with the given args.
*
* @param {Object} dest
* @param {Object} ...
* @return {Object} dest
* @api public
*/
(module.exports = function merge(dest){
utils.assertPresent(dest, 'dest');
dest = utils.unwrap(dest).first;
utils.assertType(dest, 'object', 'dest');
var last = utils.unwrap(arguments[arguments.length - 1]).first
, deep = (true === last.val);
for (var i = 1, len = arguments.length - deep; i < len; ++i) {
utils.merge(dest.vals, utils.unwrap(arguments[i]).first.vals, deep);
}
return dest;
}).raw = true;