o
Version:
common object helper functions
23 lines (22 loc) • 430 B
TypeScript
import { OObject } from './types';
/**
* Clone the specified object.
* Modifying the properties of a cloned object won't affect the original.
*
* @example
* ```
* const a = { a: 1 };
*
* const b = clone(a);
* b.a = 2;
*
* console.log(a.a, b.a); // => 1 2
* ```
*
* @throws TypeError
*
* @since 1.0.0
* @version 2.0.0
*/
declare function clone(obj: OObject): OObject;
export default clone;