Sha256: 5ff3e92c3d5a5c820f81c8066d6ea8063504c004355f8169d6264bec7296df8e

Contents?: true

Size: 1.04 KB

Versions: 270

Compression:

Stored size: 1.04 KB

Contents

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

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

/**
 * Creates a shallow clone of `value`.
 *
 * **Note:** This method is loosely based on the
 * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)
 * and supports cloning arrays, array buffers, booleans, date objects, maps,
 * numbers, `Object` objects, regexes, sets, strings, symbols, and typed
 * arrays. The own enumerable properties of `arguments` objects are cloned
 * as plain objects. An empty object is returned for uncloneable values such
 * as error objects, functions, DOM nodes, and WeakMaps.
 *
 * @static
 * @memberOf _
 * @since 0.1.0
 * @category Lang
 * @param {*} value The value to clone.
 * @returns {*} Returns the cloned value.
 * @see _.cloneDeep
 * @example
 *
 * var objects = [{ 'a': 1 }, { 'b': 2 }];
 *
 * var shallow = _.clone(objects);
 * console.log(shallow[0] === objects[0]);
 * // => true
 */
function clone(value) {
  return baseClone(value, CLONE_SYMBOLS_FLAG);
}

module.exports = clone;

Version data entries

270 entries across 269 versions & 28 rubygems

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