UNPKG

@naverpay/hidash

Version:

improved lodash

17 lines (15 loc) 715 B
/** * @description * Creates a shallow clone of `value`. This function handles primitives, null, and common * JavaScript object types such as Array, Date, RegExp, TypedArray (excluding DataView), * ArrayBuffer, Map, Set, and plain objects. * For plain objects, the clone will have the same prototype and a copy of its own * enumerable properties (both String-keyed and Symbol-keyed). * This function is similar in purpose to lodash's `_.clone` (which also performs a shallow clone). * * @template T - The type of the value to clone. * @param {T} value - The value to clone. * @returns {T} Returns the shallow cloned value. */ declare function clone<T>(value: T): T; export { clone, clone as default };