PHP 8.2.30
Preview: cloneDeep.js Size: 1.75 KB
//opt/alt/alt-nodejs9/root/lib/node_modules/npm/node_modules/cli-table2/node_modules/lodash/lang/cloneDeep.js

var baseClone = require('../internal/baseClone'),
    bindCallback = require('../internal/bindCallback');

/**
 * Creates a deep clone of `value`. If `customizer` is provided it's invoked
 * to produce the cloned values. If `customizer` returns `undefined` cloning
 * is handled by the method instead. The `customizer` is bound to `thisArg`
 * and invoked with up to three argument; (value [, index|key, object]).
 *
 * **Note:** This method is loosely based on the
 * [structured clone algorithm](http://www.w3.org/TR/html5/infrastructure.html#internal-structured-cloning-algorithm).
 * The enumerable properties of `arguments` objects and objects created by
 * constructors other than `Object` are cloned to plain `Object` objects. An
 * empty object is returned for uncloneable values such as functions, DOM nodes,
 * Maps, Sets, and WeakMaps.
 *
 * @static
 * @memberOf _
 * @category Lang
 * @param {*} value The value to deep clone.
 * @param {Function} [customizer] The function to customize cloning values.
 * @param {*} [thisArg] The `this` binding of `customizer`.
 * @returns {*} Returns the deep cloned value.
 * @example
 *
 * var users = [
 *   { 'user': 'barney' },
 *   { 'user': 'fred' }
 * ];
 *
 * var deep = _.cloneDeep(users);
 * deep[0] === users[0];
 * // => false
 *
 * // using a customizer callback
 * var el = _.cloneDeep(document.body, function(value) {
 *   if (_.isElement(value)) {
 *     return value.cloneNode(true);
 *   }
 * });
 *
 * el === document.body
 * // => false
 * el.nodeName
 * // => BODY
 * el.childNodes.length;
 * // => 20
 */
function cloneDeep(value, customizer, thisArg) {
  return typeof customizer == 'function'
    ? baseClone(value, true, bindCallback(customizer, thisArg, 3))
    : baseClone(value, true);
}

module.exports = cloneDeep;

Directory Contents

Dirs: 0 × Files: 30

Name Size Perms Modified Actions
2.24 KB lrw-r--r-- 2021-09-28 11:28:35
Edit Download
1.75 KB lrw-r--r-- 2021-09-28 11:28:35
Edit Download
39 B lrw-r--r-- 2021-09-28 11:28:35
Edit Download
464 B lrw-r--r-- 2021-09-28 11:28:35
Edit Download
493 B lrw-r--r-- 2021-09-28 11:28:35
Edit Download
963 B lrw-r--r-- 2021-09-28 11:28:35
Edit Download
1.13 KB lrw-r--r-- 2021-09-28 11:28:35
Edit Download
901 B lrw-r--r-- 2021-09-28 11:28:35
Edit Download
851 B lrw-r--r-- 2021-09-28 11:28:35
Edit Download
572 B lrw-r--r-- 2021-09-28 11:28:35
Edit Download
1.20 KB lrw-r--r-- 2021-09-28 11:28:35
Edit Download
1.92 KB lrw-r--r-- 2021-09-28 11:28:35
Edit Download
955 B lrw-r--r-- 2021-09-28 11:28:35
Edit Download
811 B lrw-r--r-- 2021-09-28 11:28:35
Edit Download
1.03 KB lrw-r--r-- 2021-09-28 11:28:35
Edit Download
1.86 KB lrw-r--r-- 2021-09-28 11:28:35
Edit Download
825 B lrw-r--r-- 2021-09-28 11:28:35
Edit Download
1.26 KB lrw-r--r-- 2021-09-28 11:28:35
Edit Download
365 B lrw-r--r-- 2021-09-28 11:28:35
Edit Download
1.03 KB lrw-r--r-- 2021-09-28 11:28:35
Edit Download
732 B lrw-r--r-- 2021-09-28 11:28:35
Edit Download
2.17 KB lrw-r--r-- 2021-09-28 11:28:35
Edit Download
830 B lrw-r--r-- 2021-09-28 11:28:35
Edit Download
889 B lrw-r--r-- 2021-09-28 11:28:35
Edit Download
2.44 KB lrw-r--r-- 2021-09-28 11:28:35
Edit Download
400 B lrw-r--r-- 2021-09-28 11:28:35
Edit Download
458 B lrw-r--r-- 2021-09-28 11:28:35
Edit Download
487 B lrw-r--r-- 2021-09-28 11:28:35
Edit Download
697 B lrw-r--r-- 2021-09-28 11:28:35
Edit Download
726 B lrw-r--r-- 2021-09-28 11:28:35
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).