index.d.ts 581 B

123456789101112131415
  1. export declare type Options = {
  2. props?: (string | symbol)[];
  3. nonenumerable?: boolean;
  4. };
  5. /**
  6. * Copy (clone) an object and all its props recursively to get rid of any prop referenced of the original object. Arrays are also cloned, however objects inside arrays are still linked.
  7. *
  8. * @export
  9. * @template T
  10. * @param {T} target Target can be anything
  11. * @param {Options} [options = {}] Options can be `props` or `nonenumerable`
  12. * @returns {T} the target with replaced values
  13. * @export
  14. */
  15. export declare function copy<T>(target: T, options?: Options): T;