@@ -159,7 +159,7 @@ const y = { foo: [5, 6] };
159
159
customDeepmerge (x , y ); // => { foo: [5, 6], bar: [3, 4] }
160
160
```
161
161
162
- When resolving a HKT, we use a lookup inside an interface called ` DeepMergeMergeFunctionURItoKind ` .
162
+ When resolving a HKT, we use a lookup inside an interface called ` DeepMergeFunctionURItoKind ` .
163
163
This interface needs to contain all the mappings of the URIs to their actual type.
164
164
165
165
When defining your own HKT for use with deepmerge, you need to extend this interface with your mapping.
@@ -168,9 +168,9 @@ declaring a module block for this library and defining the same interface.
168
168
169
169
``` ts
170
170
declare module " deepmerge-ts" {
171
- interface DeepMergeMergeFunctionURItoKind <
171
+ interface DeepMergeFunctionURItoKind <
172
172
Ts extends ReadonlyArray <unknown >,
173
- MF extends DeepMergeMergeFunctionsURIs ,
173
+ MF extends DeepMergeFunctionsURIs ,
174
174
M ,
175
175
> {
176
176
readonly MyCustomMergeURI: MyValue ;
@@ -184,9 +184,9 @@ Here's an example of creating a custom deepmerge function that amalgamates dates
184
184
185
185
``` ts
186
186
import {
187
+ type DeepMergeFunctionURItoKind ,
188
+ type DeepMergeFunctionsURIs ,
187
189
type DeepMergeLeaf ,
188
- type DeepMergeMergeFunctionURItoKind ,
189
- type DeepMergeMergeFunctionsURIs ,
190
190
deepmergeCustom ,
191
191
} from " deepmerge-ts" ;
192
192
@@ -213,9 +213,9 @@ const z = { foo: new Date("2022-03-03") };
213
213
customDeepmerge (x , y , z ); // => { foo: [Date, Date, Date] }
214
214
215
215
declare module " deepmerge-ts" {
216
- interface DeepMergeMergeFunctionURItoKind <
216
+ interface DeepMergeFunctionURItoKind <
217
217
Ts extends ReadonlyArray <unknown >,
218
- MF extends DeepMergeMergeFunctionsURIs ,
218
+ MF extends DeepMergeFunctionsURIs ,
219
219
M ,
220
220
> {
221
221
readonly MyDeepMergeDatesURI: EveryIsDate <Ts > extends true
@@ -247,8 +247,8 @@ Be sure to also set the `DeepMergeFilterValuesURI` to `DeepMergeNoFilteringURI`
247
247
248
248
``` ts
249
249
import {
250
- type DeepMergeMergeFunctionURItoKind ,
251
- type DeepMergeMergeFunctionsURIs ,
250
+ type DeepMergeFunctionURItoKind ,
251
+ type DeepMergeFunctionsURIs ,
252
252
type DeepMergeNoFilteringURI ,
253
253
deepmergeCustom ,
254
254
} from " deepmerge-ts" ;
@@ -275,8 +275,8 @@ Here's an example that creates a custom deepmerge function that filters out all
275
275
276
276
``` ts
277
277
import {
278
- type DeepMergeMergeFunctionURItoKind ,
279
- type DeepMergeMergeFunctionsURIs ,
278
+ type DeepMergeFunctionURItoKind ,
279
+ type DeepMergeFunctionsURIs ,
280
280
type FilterOut ,
281
281
deepmergeCustom ,
282
282
} from " deepmerge-ts" ;
@@ -299,9 +299,9 @@ const z = { key1: { subkey2: `two` } };
299
299
customizedDeepmerge (x , y , z ); // => { key1: { subkey1: `one`, subkey2: `two` } }
300
300
301
301
declare module " deepmerge-ts" {
302
- interface DeepMergeMergeFunctionURItoKind <
302
+ interface DeepMergeFunctionURItoKind <
303
303
Ts extends Readonly <ReadonlyArray <unknown >>,
304
- MF extends DeepMergeMergeFunctionsURIs ,
304
+ MF extends DeepMergeFunctionsURIs ,
305
305
M ,
306
306
> {
307
307
readonly FilterNullValues: FilterOut <Ts , null >;
@@ -318,9 +318,9 @@ under.
318
318
319
319
``` ts
320
320
import {
321
+ type DeepMergeFunctionURItoKind ,
322
+ type DeepMergeFunctionsURIs ,
321
323
type DeepMergeLeaf ,
322
- type DeepMergeMergeFunctionURItoKind ,
323
- type DeepMergeMergeFunctionsURIs ,
324
324
deepmergeCustom ,
325
325
} from " deepmerge-ts" ;
326
326
@@ -370,9 +370,9 @@ Here's an example that uses custom metadata that accumulates the full key path.
370
370
371
371
``` ts
372
372
import {
373
+ type DeepMergeFunctionURItoKind ,
374
+ type DeepMergeFunctionsURIs ,
373
375
type DeepMergeLeaf ,
374
- type DeepMergeMergeFunctionURItoKind ,
375
- type DeepMergeMergeFunctionsURIs ,
376
376
deepmergeCustom ,
377
377
} from " deepmerge-ts" ;
378
378
@@ -431,9 +431,9 @@ const y = {
431
431
customizedDeepmerge (x , y ); // => { foo: { bar: { baz: "special merge", bar: { baz: 6, qux: 7 }, qux: 2 } }, bar: { baz: "special merge", qux: 9 }, }
432
432
433
433
declare module " deepmerge-ts" {
434
- interface DeepMergeMergeFunctionURItoKind <
434
+ interface DeepMergeFunctionURItoKind <
435
435
Ts extends Readonly <ReadonlyArray <unknown >>,
436
- MF extends DeepMergeMergeFunctionsURIs ,
436
+ MF extends DeepMergeFunctionsURIs ,
437
437
M , // This is the meta data type
438
438
> {
439
439
readonly KeyPathBasedMerge: Ts [number ] extends number
@@ -507,10 +507,10 @@ type CustomizedDeepmergeInto = <
507
507
DeepMergeHKT <
508
508
[Target , ... Ts ], // Don't forget to pass the `Target` type here too.
509
509
{
510
- DeepMergeRecordsURI: DeepMergeMergeFunctionsDefaultURIs [" DeepMergeRecordsURI" ]; // Use default behavior.
511
- DeepMergeArraysURI: DeepMergeMergeFunctionsDefaultURIs [" DeepMergeArraysURI" ]; // Use default behavior.
512
- DeepMergeSetsURI: DeepMergeMergeFunctionsDefaultURIs [" DeepMergeSetsURI" ]; // Use default behavior.
513
- DeepMergeMapsURI: DeepMergeMergeFunctionsDefaultURIs [" DeepMergeMapsURI" ]; // Use default behavior.
510
+ DeepMergeRecordsURI: DeepMergeFunctionsDefaultURIs [" DeepMergeRecordsURI" ]; // Use default behavior.
511
+ DeepMergeArraysURI: DeepMergeFunctionsDefaultURIs [" DeepMergeArraysURI" ]; // Use default behavior.
512
+ DeepMergeSetsURI: DeepMergeFunctionsDefaultURIs [" DeepMergeSetsURI" ]; // Use default behavior.
513
+ DeepMergeMapsURI: DeepMergeFunctionsDefaultURIs [" DeepMergeMapsURI" ]; // Use default behavior.
514
514
DeepMergeOthersURI: " CustomDeepMergeOthersURI" ; // Use custom behavior (see deepmergeCustom's docs above for details).
515
515
},
516
516
DeepMergeBuiltInMetaData // Use default meta data.
0 commit comments