Security update for permissions_by_term
[yaffs-website] / node_modules / uncss / node_modules / lodash / cloneWith.js
1 var baseClone = require('./internal/baseClone');
2
3 /**
4  * This method is like `_.clone` except that it accepts `customizer` which
5  * is invoked to produce the cloned value. If `customizer` returns `undefined`
6  * cloning is handled by the method instead. The `customizer` is invoked with
7  * up to four arguments; (value [, index|key, object, stack]).
8  *
9  * @static
10  * @memberOf _
11  * @category Lang
12  * @param {*} value The value to clone.
13  * @param {Function} [customizer] The function to customize cloning.
14  * @returns {*} Returns the cloned value.
15  * @example
16  *
17  * function customizer(value) {
18  *   if (_.isElement(value)) {
19  *     return value.cloneNode(false);
20  *   }
21  * }
22  *
23  * var el = _.cloneWith(document.body, customizer);
24  *
25  * console.log(el === document.body);
26  * // => false
27  * console.log(el.nodeName);
28  * // => 'BODY'
29  * console.log(el.childNodes.length);
30  * // => 0
31  */
32 function cloneWith(value, customizer) {
33   return baseClone(value, false, customizer);
34 }
35
36 module.exports = cloneWith;