X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=node_modules%2Funcss%2Fnode_modules%2Flodash%2FassignWith.js;fp=node_modules%2Funcss%2Fnode_modules%2Flodash%2FassignWith.js;h=8b32b89de4d08bcc3ef7dbb2e903b0dc13f1f465;hp=0000000000000000000000000000000000000000;hb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;hpb=57c063afa3f66b07c4bbddc2d6129a96d90f0aad diff --git a/node_modules/uncss/node_modules/lodash/assignWith.js b/node_modules/uncss/node_modules/lodash/assignWith.js new file mode 100644 index 000000000..8b32b89de --- /dev/null +++ b/node_modules/uncss/node_modules/lodash/assignWith.js @@ -0,0 +1,35 @@ +var copyObjectWith = require('./internal/copyObjectWith'), + createAssigner = require('./internal/createAssigner'), + keys = require('./keys'); + +/** + * This method is like `_.assign` except that it accepts `customizer` which + * is invoked to produce the assigned values. If `customizer` returns `undefined` + * assignment is handled by the method instead. The `customizer` is invoked + * with five arguments: (objValue, srcValue, key, object, source). + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @category Object + * @param {Object} object The destination object. + * @param {...Object} sources The source objects. + * @param {Function} [customizer] The function to customize assigned values. + * @returns {Object} Returns `object`. + * @example + * + * function customizer(objValue, srcValue) { + * return _.isUndefined(objValue) ? srcValue : objValue; + * } + * + * var defaults = _.partialRight(_.assignWith, customizer); + * + * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); + * // => { 'a': 1, 'b': 2 } + */ +var assignWith = createAssigner(function(object, source, srcIndex, customizer) { + copyObjectWith(source, keys(source), object, customizer); +}); + +module.exports = assignWith;