basant307/AI_Governance_Project
045
1import baseClone from './_baseClone.js';2 3/** Used to compose bitmasks for cloning. */4var CLONE_SYMBOLS_FLAG = 4;5 6/**7 * Creates a shallow clone of `value`.8 *9 * **Note:** This method is loosely based on the10 * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)11 * and supports cloning arrays, array buffers, booleans, date objects, maps,12 * numbers, `Object` objects, regexes, sets, strings, symbols, and typed13 * arrays. The own enumerable properties of `arguments` objects are cloned14 * as plain objects. An empty object is returned for uncloneable values such15 * as error objects, functions, DOM nodes, and WeakMaps.16 *17 * @static18 * @memberOf _19 * @since 0.1.020 * @category Lang21 * @param {*} value The value to clone.22 * @returns {*} Returns the cloned value.23 * @see _.cloneDeep24 * @example25 *26 * var objects = [{ 'a': 1 }, { 'b': 2 }];27 *28 * var shallow = _.clone(objects);29 * console.log(shallow[0] === objects[0]);30 * // => true31 */32function clone(value) {33 return baseClone(value, CLONE_SYMBOLS_FLAG);34}35 36export default clone;37 