|
Last change
on this file was a762898, checked in by istevanoska <ilinastevanoska@…>, 5 months ago |
|
Added visualizations
|
-
Property mode
set to
100644
|
|
File size:
1.1 KB
|
| Line | |
|---|
| 1 | type CloneDeepWithCustomizer<TObject> = (value: any, key: number | string | undefined, object: TObject | undefined, stack: any) => any;
|
|---|
| 2 | /**
|
|---|
| 3 | * Creates a deep clone of the given value using a customizer function.
|
|---|
| 4 | *
|
|---|
| 5 | * @template T - The type of the value.
|
|---|
| 6 | * @param {T} value - The value to clone.
|
|---|
| 7 | * @param {CloneDeepWithCustomizer<T>} customizer - A function to customize the cloning process.
|
|---|
| 8 | * @returns {any} - A deep clone of the given value.
|
|---|
| 9 | *
|
|---|
| 10 | * @example
|
|---|
| 11 | * const obj = { a: 1, b: 2 };
|
|---|
| 12 | * const clonedObj = cloneDeepWith(obj, (value) => {
|
|---|
| 13 | * if (typeof value === 'number') {
|
|---|
| 14 | * return value * 2;
|
|---|
| 15 | * }
|
|---|
| 16 | * });
|
|---|
| 17 | * // => { a: 2, b: 4 }
|
|---|
| 18 | */
|
|---|
| 19 | declare function cloneDeepWith<T>(value: T, customizer: CloneDeepWithCustomizer<T>): any;
|
|---|
| 20 | /**
|
|---|
| 21 | * Creates a deep clone of the given value.
|
|---|
| 22 | *
|
|---|
| 23 | * @template T - The type of the value.
|
|---|
| 24 | * @param {T} value - The value to clone.
|
|---|
| 25 | * @returns {T} - A deep clone of the given value.
|
|---|
| 26 | *
|
|---|
| 27 | * @example
|
|---|
| 28 | * const obj = { a: 1, b: { c: 2 } };
|
|---|
| 29 | * const clonedObj = cloneDeepWith(obj);
|
|---|
| 30 | * // => { a: 1, b: { c: 2 } }
|
|---|
| 31 | */
|
|---|
| 32 | declare function cloneDeepWith<T>(value: T): T;
|
|---|
| 33 |
|
|---|
| 34 | export { cloneDeepWith };
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.