deepie-merge 3.0.0 → 3.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +6 -2
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -8,9 +8,13 @@ type DeepieMergeOpts<T = any> = {
|
|
|
8
8
|
type DeepMergeable = {
|
|
9
9
|
[key: string]: any;
|
|
10
10
|
} | Array<any>;
|
|
11
|
-
|
|
11
|
+
/** Same top-level shape as `T` (array vs object) with the same keys, but with
|
|
12
|
+
* values widened to `unknown`. Catches array/object mismatches and top-level
|
|
13
|
+
* excess keys on fresh literals, while accepting wider override types
|
|
14
|
+
* (e.g. `Partial<UserConfig>` against a `satisfies`-narrowed literal). */
|
|
15
|
+
type DeepMergeSource<T> = T extends ReadonlyArray<any> ? ReadonlyArray<unknown> : T extends object ? { [K in keyof T]?: unknown } : never;
|
|
12
16
|
/** deep-merge b into a */
|
|
13
|
-
declare function deepMerge<T extends DeepMergeable>(a: T, b:
|
|
17
|
+
declare function deepMerge<T extends DeepMergeable>(a: T, b: NoInfer<T> | DeepMergeSource<NoInfer<T>> | null | undefined, {
|
|
14
18
|
arrayExtend,
|
|
15
19
|
maxRecursion,
|
|
16
20
|
clone
|