X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=node_modules%2Fgrunt-legacy-util%2Fnode_modules%2Flodash%2F_copyObjectWith.js;fp=node_modules%2Fgrunt-legacy-util%2Fnode_modules%2Flodash%2F_copyObjectWith.js;h=ac5b9d3be81e3709ae2eaf37eeb6a762d879ed4e;hp=0000000000000000000000000000000000000000;hb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;hpb=57c063afa3f66b07c4bbddc2d6129a96d90f0aad diff --git a/node_modules/grunt-legacy-util/node_modules/lodash/_copyObjectWith.js b/node_modules/grunt-legacy-util/node_modules/lodash/_copyObjectWith.js new file mode 100644 index 000000000..ac5b9d3be --- /dev/null +++ b/node_modules/grunt-legacy-util/node_modules/lodash/_copyObjectWith.js @@ -0,0 +1,29 @@ +var assignValue = require('./_assignValue'); + +/** + * This function is like `copyObject` except that it accepts a function to + * customize copied values. + * + * @private + * @param {Object} source The object to copy properties from. + * @param {Array} props The property names to copy. + * @param {Object} [object={}] The object to copy properties to. + * @param {Function} [customizer] The function to customize copied values. + * @returns {Object} Returns `object`. + */ +function copyObjectWith(source, props, object, customizer) { + object || (object = {}); + + var index = -1, + length = props.length; + + while (++index < length) { + var key = props[index], + newValue = customizer ? customizer(object[key], source[key], key, object, source) : source[key]; + + assignValue(object, key, newValue); + } + return object; +} + +module.exports = copyObjectWith;