source: node_modules/es-toolkit/dist/compat/object/merge.d.ts

Last change on this file was a762898, checked in by istevanoska <ilinastevanoska@…>, 5 months ago

Added visualizations

  • Property mode set to 100644
File size: 2.8 KB
Line 
1/**
2 * Recursively merges own and inherited enumerable string keyed properties of source objects into the destination object.
3 *
4 * @template T
5 * @template U
6 * @param {T} object - The destination object.
7 * @param {U} source - The source object.
8 * @returns {T & U} - Returns `object`.
9 *
10 * @example
11 * const object = { a: [{ b: 2 }, { d: 4 }] };
12 * const other = { a: [{ c: 3 }, { e: 5 }] };
13 * merge(object, other);
14 * // => { a: [{ b: 2, c: 3 }, { d: 4, e: 5 }] }
15 */
16declare function merge<T, U>(object: T, source: U): T & U;
17/**
18 * Recursively merges own and inherited enumerable string keyed properties of source objects into the destination object.
19 *
20 * @template T
21 * @template U
22 * @template V
23 * @param {T} object - The destination object.
24 * @param {U} source1 - The first source object.
25 * @param {V} source2 - The second source object.
26 * @returns {T & U & V} - Returns `object`.
27 *
28 * @example
29 * merge({ a: 1 }, { b: 2 }, { c: 3 });
30 * // => { a: 1, b: 2, c: 3 }
31 */
32declare function merge<T, U, V>(object: T, source1: U, source2: V): T & U & V;
33/**
34 * Recursively merges own and inherited enumerable string keyed properties of source objects into the destination object.
35 *
36 * @template T
37 * @template U
38 * @template V
39 * @template W
40 * @param {T} object - The destination object.
41 * @param {U} source1 - The first source object.
42 * @param {V} source2 - The second source object.
43 * @param {W} source3 - The third source object.
44 * @returns {T & U & V & W} - Returns `object`.
45 *
46 * @example
47 * merge({ a: 1 }, { b: 2 }, { c: 3 }, { d: 4 });
48 * // => { a: 1, b: 2, c: 3, d: 4 }
49 */
50declare function merge<T, U, V, W>(object: T, source1: U, source2: V, source3: W): T & U & V & W;
51/**
52 * Recursively merges own and inherited enumerable string keyed properties of source objects into the destination object.
53 *
54 * @template T
55 * @template U
56 * @template V
57 * @template W
58 * @template X
59 * @param {T} object - The destination object.
60 * @param {U} source1 - The first source object.
61 * @param {V} source2 - The second source object.
62 * @param {W} source3 - The third source object.
63 * @param {X} source4 - The fourth source object.
64 * @returns {T & U & V & W & X} - Returns `object`.
65 *
66 * @example
67 * merge({ a: 1 }, { b: 2 }, { c: 3 }, { d: 4 }, { e: 5 });
68 * // => { a: 1, b: 2, c: 3, d: 4, e: 5 }
69 */
70declare function merge<T, U, V, W, X>(object: T, source1: U, source2: V, source3: W, source4: X): T & U & V & W & X;
71/**
72 * Recursively merges own and inherited enumerable string keyed properties of source objects into the destination object.
73 *
74 * @param {any} object - The destination object.
75 * @param {...any[]} otherArgs - The source objects.
76 * @returns {any} - Returns `object`.
77 *
78 * @example
79 * merge({ a: 1 }, { b: 2 }, { c: 3 });
80 * // => { a: 1, b: 2, c: 3 }
81 */
82declare function merge(object: any, ...otherArgs: any[]): any;
83
84export { merge };
Note: See TracBrowser for help on using the repository browser.