X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=node_modules%2Fgrunt-legacy-util%2Fnode_modules%2Flodash%2FcloneWith.js;fp=node_modules%2Fgrunt-legacy-util%2Fnode_modules%2Flodash%2FcloneWith.js;h=1bc6035a211de8ca99f7c0f8a82973c8432ed456;hp=0000000000000000000000000000000000000000;hb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;hpb=57c063afa3f66b07c4bbddc2d6129a96d90f0aad diff --git a/node_modules/grunt-legacy-util/node_modules/lodash/cloneWith.js b/node_modules/grunt-legacy-util/node_modules/lodash/cloneWith.js new file mode 100644 index 000000000..1bc6035a2 --- /dev/null +++ b/node_modules/grunt-legacy-util/node_modules/lodash/cloneWith.js @@ -0,0 +1,36 @@ +var baseClone = require('./_baseClone'); + +/** + * This method is like `_.clone` except that it accepts `customizer` which + * is invoked to produce the cloned value. If `customizer` returns `undefined` + * cloning is handled by the method instead. The `customizer` is invoked with + * up to four arguments; (value [, index|key, object, stack]). + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to clone. + * @param {Function} [customizer] The function to customize cloning. + * @returns {*} Returns the cloned value. + * @example + * + * function customizer(value) { + * if (_.isElement(value)) { + * return value.cloneNode(false); + * } + * } + * + * var el = _.cloneWith(document.body, customizer); + * + * console.log(el === document.body); + * // => false + * console.log(el.nodeName); + * // => 'BODY' + * console.log(el.childNodes.length); + * // => 0 + */ +function cloneWith(value, customizer) { + return baseClone(value, false, customizer); +} + +module.exports = cloneWith;