Sha256: 5d6b64289ea9139b11d76f2e5f015afddbdb0ba5e2a56964190c757b1c41f32c

Contents?: true

Size: 1.02 KB

Versions: 270

Compression:

Stored size: 1.02 KB

Contents

var baseClone = require('./_baseClone');

/** Used to compose bitmasks for cloning. */
var CLONE_DEEP_FLAG = 1,
    CLONE_SYMBOLS_FLAG = 4;

/**
 * This method is like `_.cloneWith` except that it recursively clones `value`.
 *
 * @static
 * @memberOf _
 * @since 4.0.0
 * @category Lang
 * @param {*} value The value to recursively clone.
 * @param {Function} [customizer] The function to customize cloning.
 * @returns {*} Returns the deep cloned value.
 * @see _.cloneWith
 * @example
 *
 * function customizer(value) {
 *   if (_.isElement(value)) {
 *     return value.cloneNode(true);
 *   }
 * }
 *
 * var el = _.cloneDeepWith(document.body, customizer);
 *
 * console.log(el === document.body);
 * // => false
 * console.log(el.nodeName);
 * // => 'BODY'
 * console.log(el.childNodes.length);
 * // => 20
 */
function cloneDeepWith(value, customizer) {
  customizer = typeof customizer == 'function' ? customizer : undefined;
  return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);
}

module.exports = cloneDeepWith;

Version data entries

270 entries across 269 versions & 28 rubygems

Version Path
immosquare-cleaner-0.1.60 node_modules/lodash/cloneDeepWith.js
immosquare-cleaner-0.1.59 node_modules/lodash/cloneDeepWith.js
immosquare-cleaner-0.1.58 node_modules/lodash/cloneDeepWith.js
immosquare-cleaner-0.1.57 node_modules/lodash/cloneDeepWith.js
immosquare-cleaner-0.1.56 node_modules/lodash/cloneDeepWith.js
immosquare-cleaner-0.1.55 node_modules/lodash/cloneDeepWith.js
immosquare-cleaner-0.1.54 node_modules/lodash/cloneDeepWith.js
immosquare-cleaner-0.1.53 node_modules/lodash/cloneDeepWith.js
immosquare-cleaner-0.1.52 node_modules/lodash/cloneDeepWith.js
trusty-cms-6.3.1 node_modules/lodash/cloneDeepWith.js
immosquare-cleaner-0.1.51 node_modules/lodash/cloneDeepWith.js
boring_generators-0.15.0 tmp/templates/app_template/node_modules/lodash/cloneDeepWith.js
clapton-0.0.26 lib/clapton/javascripts/node_modules/lodash/cloneDeepWith.js
clapton-0.0.25 lib/clapton/javascripts/node_modules/lodash/cloneDeepWith.js
immosquare-cleaner-0.1.50 node_modules/lodash/cloneDeepWith.js
clapton-0.0.24 lib/clapton/javascripts/node_modules/lodash/cloneDeepWith.js
clapton-0.0.23 lib/clapton/javascripts/node_modules/lodash/cloneDeepWith.js
clapton-0.0.22 lib/clapton/javascripts/node_modules/lodash/cloneDeepWith.js
clapton-0.0.21 lib/clapton/javascripts/node_modules/lodash/cloneDeepWith.js
clapton-0.0.20 lib/clapton/javascripts/node_modules/lodash/cloneDeepWith.js