@oscarpalmer/atoms 0.77.0 → 0.77.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.
Files changed (54) hide show
  1. package/dist/js/array/chunk.cjs +1 -1
  2. package/dist/js/array/chunk.js +1 -1
  3. package/dist/js/value/equal.cjs +4 -1
  4. package/dist/js/value/equal.js +4 -1
  5. package/package.json +1 -1
  6. package/src/js/array/chunk.ts +1 -1
  7. package/src/js/array/count.ts +6 -6
  8. package/src/js/array/exists.ts +6 -6
  9. package/src/js/array/filter.ts +6 -6
  10. package/src/js/array/find.ts +6 -6
  11. package/src/js/array/group-by.ts +67 -55
  12. package/src/js/array/index-of.ts +6 -6
  13. package/src/js/array/sort.ts +20 -0
  14. package/src/js/array/to-map.ts +55 -47
  15. package/src/js/array/to-record.ts +61 -57
  16. package/src/js/array/unique.ts +6 -6
  17. package/src/js/internal/value/handle.ts +5 -5
  18. package/src/js/value/clone.ts +3 -1
  19. package/src/js/value/equal.ts +4 -1
  20. package/src/js/value/get.ts +9 -9
  21. package/src/js/value/set.ts +10 -11
  22. package/types/array/count.d.cts +34 -2
  23. package/types/array/count.d.ts +3 -3
  24. package/types/array/exists.d.cts +34 -2
  25. package/types/array/exists.d.ts +3 -3
  26. package/types/array/filter.d.cts +34 -2
  27. package/types/array/filter.d.ts +3 -3
  28. package/types/array/find.d.cts +34 -2
  29. package/types/array/find.d.ts +3 -3
  30. package/types/array/group-by.d.cts +44 -12
  31. package/types/array/group-by.d.ts +14 -14
  32. package/types/array/index-of.d.cts +34 -2
  33. package/types/array/index-of.d.ts +3 -3
  34. package/types/array/index.d.cts +88 -46
  35. package/types/array/sort.d.cts +42 -0
  36. package/types/array/sort.d.ts +11 -1
  37. package/types/array/to-map.d.cts +42 -10
  38. package/types/array/to-map.d.ts +13 -13
  39. package/types/array/to-record.d.cts +44 -12
  40. package/types/array/to-record.d.ts +13 -13
  41. package/types/array/unique.d.cts +34 -2
  42. package/types/array/unique.d.ts +3 -3
  43. package/types/index.d.cts +1034 -317
  44. package/types/internal/value/handle.d.cts +27 -2
  45. package/types/internal/value/handle.d.ts +2 -2
  46. package/types/models.d.cts +467 -210
  47. package/types/value/clone.d.cts +1 -1
  48. package/types/value/clone.d.ts +1 -1
  49. package/types/value/get.d.cts +470 -211
  50. package/types/value/get.d.ts +3 -3
  51. package/types/value/index.d.cts +515 -224
  52. package/types/value/set.d.cts +357 -170
  53. package/types/value/set.d.ts +3 -3
  54. package/types/value/smush.d.cts +463 -209
@@ -5,7 +5,14 @@ Matches any [primitive value](https://developer.mozilla.org/en-US/docs/Glossary/
5
5
 
6
6
  @category Type
7
7
  */
8
- export type Primitive = null | undefined | string | number | boolean | symbol | bigint;
8
+ export type Primitive =
9
+ | null
10
+ | undefined
11
+ | string
12
+ | number
13
+ | boolean
14
+ | symbol
15
+ | bigint;
9
16
  declare const emptyObjectSymbol: unique symbol;
10
17
  /**
11
18
  Represents a strictly empty plain object, the `{}` value.
@@ -62,7 +69,11 @@ type Includes<Value extends readonly any[], Item> =
62
69
  @category Type Guard
63
70
  @category Utilities
64
71
  */
65
- export type IsEqual<A, B> = (<G>() => G extends A ? 1 : 2) extends (<G>() => G extends B ? 1 : 2) ? true : false;
72
+ export type IsEqual<A, B> = (<G>() => G extends A ? 1 : 2) extends <
73
+ G,
74
+ >() => G extends B ? 1 : 2
75
+ ? true
76
+ : false;
66
77
  /**
67
78
  Represents an object with `unknown` value. You probably want this instead of `{}`.
68
79
 
@@ -129,14 +140,16 @@ type B = StaticPartOfArray<A>;
129
140
  //=> [string, number, boolean]
130
141
  ```
131
142
  */
132
- export type StaticPartOfArray<T extends UnknownArray, Result extends UnknownArray = [
133
- ]> = T extends unknown ? number extends T["length"] ? T extends readonly [
134
- infer U,
135
- ...infer V
136
- ] ? StaticPartOfArray<V, [
137
- ...Result,
138
- U
139
- ]> : Result : T : never; // Should never happen
143
+ export type StaticPartOfArray<
144
+ T extends UnknownArray,
145
+ Result extends UnknownArray = [],
146
+ > = T extends unknown
147
+ ? number extends T['length']
148
+ ? T extends readonly [infer U, ...infer V]
149
+ ? StaticPartOfArray<V, [...Result, U]>
150
+ : Result
151
+ : T
152
+ : never; // Should never happen
140
153
  /**
141
154
  Returns the variable, non-fixed-length portion of the given array, excluding static-length parts.
142
155
 
@@ -147,12 +160,22 @@ type B = VariablePartOfArray<A>;
147
160
  //=> string[]
148
161
  ```
149
162
  */
150
- export type VariablePartOfArray<T extends UnknownArray> = T extends unknown ? T extends readonly [
151
- ...StaticPartOfArray<T>,
152
- ...infer U
153
- ] ? U : [
154
- ] : never; // Should never happen
155
- export type StringDigit = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9";
163
+ export type VariablePartOfArray<T extends UnknownArray> = T extends unknown
164
+ ? T extends readonly [...StaticPartOfArray<T>, ...infer U]
165
+ ? U
166
+ : []
167
+ : never; // Should never happen
168
+ export type StringDigit =
169
+ | '0'
170
+ | '1'
171
+ | '2'
172
+ | '3'
173
+ | '4'
174
+ | '5'
175
+ | '6'
176
+ | '7'
177
+ | '8'
178
+ | '9';
156
179
  /**
157
180
  Returns a boolean for whether the given type is `any`.
158
181
 
@@ -195,7 +218,7 @@ Please upvote [this issue](https://github.com/microsoft/TypeScript/issues/32277)
195
218
  */
196
219
  // See https://github.com/microsoft/TypeScript/issues/31752
197
220
  // eslint-disable-next-line @typescript-eslint/no-loss-of-precision
198
- export type PositiveInfinity = Infinity;
221
+ export type PositiveInfinity = 1e999;
199
222
  /**
200
223
  Matches the hidden `-Infinity` type.
201
224
 
@@ -207,7 +230,7 @@ Please upvote [this issue](https://github.com/microsoft/TypeScript/issues/32277)
207
230
  */
208
231
  // See https://github.com/microsoft/TypeScript/issues/31752
209
232
  // eslint-disable-next-line @typescript-eslint/no-loss-of-precision
210
- export type NegativeInfinity = -Infinity;
233
+ export type NegativeInfinity = -1e999;
211
234
  /**
212
235
  A negative `number`/`bigint` (`-∞ < x < 0`)
213
236
 
@@ -218,7 +241,11 @@ Use-case: Validating and documenting parameters.
218
241
 
219
242
  @category Numeric
220
243
  */
221
- export type Negative<T extends Numeric> = T extends Zero ? never : `${T}` extends `-${string}` ? T : never;
244
+ export type Negative<T extends Numeric> = T extends Zero
245
+ ? never
246
+ : `${T}` extends `-${string}`
247
+ ? T
248
+ : never;
222
249
  /**
223
250
  Returns a boolean for whether the given number is a negative number.
224
251
 
@@ -234,7 +261,9 @@ type ShouldBeTrue = IsNegative<-1>;
234
261
 
235
262
  @category Numeric
236
263
  */
237
- export type IsNegative<T extends Numeric> = T extends Negative<T> ? true : false;
264
+ export type IsNegative<T extends Numeric> = T extends Negative<T>
265
+ ? true
266
+ : false;
238
267
  /**
239
268
  Returns a boolean for whether two given types are both true.
240
269
 
@@ -255,11 +284,12 @@ And<true, false>;
255
284
  */
256
285
  export type And<A extends boolean, B extends boolean> = [
257
286
  A,
258
- B
259
- ][number] extends true ? true : true extends [
260
- IsEqual<A, false>,
261
- IsEqual<B, false>
262
- ][number] ? false : never;
287
+ B,
288
+ ][number] extends true
289
+ ? true
290
+ : true extends [IsEqual<A, false>, IsEqual<B, false>][number]
291
+ ? false
292
+ : never;
263
293
  /**
264
294
  Returns a boolean for whether either of two given types are true.
265
295
 
@@ -280,11 +310,12 @@ Or<false, false>;
280
310
  */
281
311
  export type Or<A extends boolean, B extends boolean> = [
282
312
  A,
283
- B
284
- ][number] extends false ? false : true extends [
285
- IsEqual<A, true>,
286
- IsEqual<B, true>
287
- ][number] ? true : never;
313
+ B,
314
+ ][number] extends false
315
+ ? false
316
+ : true extends [IsEqual<A, true>, IsEqual<B, true>][number]
317
+ ? true
318
+ : never;
288
319
  /**
289
320
  Returns a boolean for whether a given number is greater than another number.
290
321
 
@@ -302,32 +333,44 @@ GreaterThan<1, 5>;
302
333
  //=> false
303
334
  ```
304
335
  */
305
- export type GreaterThan<A extends number, B extends number> = number extends A | B ? never : [
306
- IsEqual<A, PositiveInfinity>,
307
- IsEqual<A, NegativeInfinity>,
308
- IsEqual<B, PositiveInfinity>,
309
- IsEqual<B, NegativeInfinity>
310
- ] extends infer R extends [
311
- boolean,
312
- boolean,
313
- boolean,
314
- boolean
315
- ] ? Or<And<IsEqual<R[0], true>, IsEqual<R[2], false>>, And<IsEqual<R[3], true>, IsEqual<R[1], false>>> extends true ? true : Or<And<IsEqual<R[1], true>, IsEqual<R[3], false>>, And<IsEqual<R[2], true>, IsEqual<R[0], false>>> extends true ? false : true extends R[number] ? false : [
316
- IsNegative<A>,
317
- IsNegative<B>
318
- ] extends infer R extends [
319
- boolean,
320
- boolean
321
- ] ? [
322
- true,
323
- false
324
- ] extends R ? false : [
325
- false,
326
- true
327
- ] extends R ? true : [
328
- false,
329
- false
330
- ] extends R ? PositiveNumericStringGt<`${A}`, `${B}`> : PositiveNumericStringGt<`${NumberAbsolute<B>}`, `${NumberAbsolute<A>}`> : never : never;
336
+ export type GreaterThan<A extends number, B extends number> = number extends
337
+ | A
338
+ | B
339
+ ? never
340
+ : [
341
+ IsEqual<A, PositiveInfinity>,
342
+ IsEqual<A, NegativeInfinity>,
343
+ IsEqual<B, PositiveInfinity>,
344
+ IsEqual<B, NegativeInfinity>,
345
+ ] extends infer R extends [boolean, boolean, boolean, boolean]
346
+ ? Or<
347
+ And<IsEqual<R[0], true>, IsEqual<R[2], false>>,
348
+ And<IsEqual<R[3], true>, IsEqual<R[1], false>>
349
+ > extends true
350
+ ? true
351
+ : Or<
352
+ And<IsEqual<R[1], true>, IsEqual<R[3], false>>,
353
+ And<IsEqual<R[2], true>, IsEqual<R[0], false>>
354
+ > extends true
355
+ ? false
356
+ : true extends R[number]
357
+ ? false
358
+ : [IsNegative<A>, IsNegative<B>] extends infer R extends [
359
+ boolean,
360
+ boolean,
361
+ ]
362
+ ? [true, false] extends R
363
+ ? false
364
+ : [false, true] extends R
365
+ ? true
366
+ : [false, false] extends R
367
+ ? PositiveNumericStringGt<`${A}`, `${B}`>
368
+ : PositiveNumericStringGt<
369
+ `${NumberAbsolute<B>}`,
370
+ `${NumberAbsolute<A>}`
371
+ >
372
+ : never
373
+ : never;
331
374
  /**
332
375
  Returns a boolean for whether a given number is greater than or equal to another number.
333
376
 
@@ -345,7 +388,10 @@ GreaterThanOrEqual<1, 5>;
345
388
  //=> false
346
389
  ```
347
390
  */
348
- export type GreaterThanOrEqual<A extends number, B extends number> = number extends A | B ? never : A extends B ? true : GreaterThan<A, B>;
391
+ export type GreaterThanOrEqual<
392
+ A extends number,
393
+ B extends number,
394
+ > = number extends A | B ? never : A extends B ? true : GreaterThan<A, B>;
349
395
  /**
350
396
  Returns a boolean for whether a given number is less than another number.
351
397
 
@@ -363,7 +409,11 @@ LessThan<1, 5>;
363
409
  //=> true
364
410
  ```
365
411
  */
366
- export type LessThan<A extends number, B extends number> = number extends A | B ? never : GreaterThanOrEqual<A, B> extends true ? false : true;
412
+ export type LessThan<A extends number, B extends number> = number extends A | B
413
+ ? never
414
+ : GreaterThanOrEqual<A, B> extends true
415
+ ? false
416
+ : true;
367
417
  /**
368
418
  Create a tuple type of the given length `<L>` and fill it with the given type `<Fill>`.
369
419
 
@@ -371,11 +421,11 @@ If `<Fill>` is not provided, it will default to `unknown`.
371
421
 
372
422
  @link https://itnext.io/implementing-arithmetic-within-typescripts-type-system-a1ef140a6f6f
373
423
  */
374
- export type BuildTuple<L extends number, Fill = unknown, T extends readonly unknown[] = [
375
- ]> = T["length"] extends L ? T : BuildTuple<L, Fill, [
376
- ...T,
377
- Fill
378
- ]>;
424
+ export type BuildTuple<
425
+ L extends number,
426
+ Fill = unknown,
427
+ T extends readonly unknown[] = [],
428
+ > = T['length'] extends L ? T : BuildTuple<L, Fill, [...T, Fill]>;
379
429
  /**
380
430
  Returns the maximum value from a tuple of integers.
381
431
 
@@ -391,10 +441,16 @@ ArrayMax<[1, 2, 5, 3, 99, -1]>;
391
441
  //=> 99
392
442
  ```
393
443
  */
394
- export type TupleMax<A extends number[], Result extends number = NegativeInfinity> = number extends A[number] ? never : A extends [
395
- infer F extends number,
396
- ...infer R extends number[]
397
- ] ? GreaterThan<F, Result> extends true ? TupleMax<R, F> : TupleMax<R, Result> : Result;
444
+ export type TupleMax<
445
+ A extends number[],
446
+ Result extends number = NegativeInfinity,
447
+ > = number extends A[number]
448
+ ? never
449
+ : A extends [infer F extends number, ...infer R extends number[]]
450
+ ? GreaterThan<F, Result> extends true
451
+ ? TupleMax<R, F>
452
+ : TupleMax<R, Result>
453
+ : Result;
398
454
  /**
399
455
  Returns the minimum value from a tuple of integers.
400
456
 
@@ -410,10 +466,16 @@ ArrayMin<[1, 2, 5, 3, -5]>;
410
466
  //=> -5
411
467
  ```
412
468
  */
413
- export type TupleMin<A extends number[], Result extends number = PositiveInfinity> = number extends A[number] ? never : A extends [
414
- infer F extends number,
415
- ...infer R extends number[]
416
- ] ? LessThan<F, Result> extends true ? TupleMin<R, F> : TupleMin<R, Result> : Result;
469
+ export type TupleMin<
470
+ A extends number[],
471
+ Result extends number = PositiveInfinity,
472
+ > = number extends A[number]
473
+ ? never
474
+ : A extends [infer F extends number, ...infer R extends number[]]
475
+ ? LessThan<F, Result> extends true
476
+ ? TupleMin<R, F>
477
+ : TupleMin<R, Result>
478
+ : Result;
417
479
  /**
418
480
  Return a string representation of the given string or number.
419
481
 
@@ -448,7 +510,14 @@ type NegativeInfinity = StringToNumber<'-Infinity'>;
448
510
  @category Numeric
449
511
  @category Template literal
450
512
  */
451
- export type StringToNumber<S extends string> = S extends `${infer N extends number}` ? N : S extends "Infinity" ? PositiveInfinity : S extends "-Infinity" ? NegativeInfinity : never;
513
+ export type StringToNumber<S extends string> =
514
+ S extends `${infer N extends number}`
515
+ ? N
516
+ : S extends 'Infinity'
517
+ ? PositiveInfinity
518
+ : S extends '-Infinity'
519
+ ? NegativeInfinity
520
+ : never;
452
521
  /**
453
522
  Returns an array of the characters of the string.
454
523
 
@@ -463,11 +532,14 @@ StringToArray<string>;
463
532
 
464
533
  @category String
465
534
  */
466
- export type StringToArray<S extends string, Result extends string[] = [
467
- ]> = string extends S ? never : S extends `${infer F}${infer R}` ? StringToArray<R, [
468
- ...Result,
469
- F
470
- ]> : Result;
535
+ export type StringToArray<
536
+ S extends string,
537
+ Result extends string[] = [],
538
+ > = string extends S
539
+ ? never
540
+ : S extends `${infer F}${infer R}`
541
+ ? StringToArray<R, [...Result, F]>
542
+ : Result;
471
543
  /**
472
544
  Returns the length of the given string.
473
545
 
@@ -483,7 +555,9 @@ StringLength<string>;
483
555
  @category String
484
556
  @category Template literal
485
557
  */
486
- export type StringLength<S extends string> = string extends S ? never : StringToArray<S>["length"];
558
+ export type StringLength<S extends string> = string extends S
559
+ ? never
560
+ : StringToArray<S>['length'];
487
561
  /**
488
562
  Returns a boolean for whether `A` represents a number greater than `B`, where `A` and `B` are both numeric strings and have the same length.
489
563
 
@@ -496,8 +570,17 @@ SameLengthPositiveNumericStringGt<'10', '10'>;
496
570
  //=> false
497
571
  ```
498
572
  */
499
- export type SameLengthPositiveNumericStringGt<A extends string, B extends string> = A extends `${infer FirstA}${infer RestA}` ? B extends `${infer FirstB}${infer RestB}` ? FirstA extends FirstB ? SameLengthPositiveNumericStringGt<RestA, RestB> : PositiveNumericCharacterGt<FirstA, FirstB> : never : false;
500
- export type NumericString = "0123456789";
573
+ export type SameLengthPositiveNumericStringGt<
574
+ A extends string,
575
+ B extends string,
576
+ > = A extends `${infer FirstA}${infer RestA}`
577
+ ? B extends `${infer FirstB}${infer RestB}`
578
+ ? FirstA extends FirstB
579
+ ? SameLengthPositiveNumericStringGt<RestA, RestB>
580
+ : PositiveNumericCharacterGt<FirstA, FirstB>
581
+ : never
582
+ : false;
583
+ export type NumericString = '0123456789';
501
584
  /**
502
585
  Returns a boolean for whether `A` is greater than `B`, where `A` and `B` are both positive numeric strings.
503
586
 
@@ -513,16 +596,21 @@ PositiveNumericStringGt<'1', '500'>;
513
596
  //=> false
514
597
  ```
515
598
  */
516
- export type PositiveNumericStringGt<A extends string, B extends string> = A extends B ? false : [
517
- BuildTuple<StringLength<A>, 0>,
518
- BuildTuple<StringLength<B>, 0>
519
- ] extends infer R extends [
520
- readonly unknown[],
521
- readonly unknown[]
522
- ] ? R[0] extends [
523
- ...R[1],
524
- ...infer Remain extends readonly unknown[]
525
- ] ? 0 extends Remain["length"] ? SameLengthPositiveNumericStringGt<A, B> : true : false : never;
599
+ export type PositiveNumericStringGt<
600
+ A extends string,
601
+ B extends string,
602
+ > = A extends B
603
+ ? false
604
+ : [
605
+ BuildTuple<StringLength<A>, 0>,
606
+ BuildTuple<StringLength<B>, 0>,
607
+ ] extends infer R extends [readonly unknown[], readonly unknown[]]
608
+ ? R[0] extends [...R[1], ...infer Remain extends readonly unknown[]]
609
+ ? 0 extends Remain['length']
610
+ ? SameLengthPositiveNumericStringGt<A, B>
611
+ : true
612
+ : false
613
+ : never;
526
614
  /**
527
615
  Returns a boolean for whether `A` represents a number greater than `B`, where `A` and `B` are both positive numeric characters.
528
616
 
@@ -535,7 +623,16 @@ PositiveNumericCharacterGt<'1', '1'>;
535
623
  //=> false
536
624
  ```
537
625
  */
538
- export type PositiveNumericCharacterGt<A extends string, B extends string> = NumericString extends `${infer HeadA}${A}${infer TailA}` ? NumericString extends `${infer HeadB}${B}${infer TailB}` ? HeadA extends `${HeadB}${infer _}${infer __}` ? true : false : never : never;
626
+ export type PositiveNumericCharacterGt<
627
+ A extends string,
628
+ B extends string,
629
+ > = NumericString extends `${infer HeadA}${A}${infer TailA}`
630
+ ? NumericString extends `${infer HeadB}${B}${infer TailB}`
631
+ ? HeadA extends `${HeadB}${infer _}${infer __}`
632
+ ? true
633
+ : false
634
+ : never
635
+ : never;
539
636
  /**
540
637
  Returns the absolute value of a given value.
541
638
 
@@ -551,7 +648,10 @@ NumberAbsolute<NegativeInfinity>
551
648
  //=> PositiveInfinity
552
649
  ```
553
650
  */
554
- export type NumberAbsolute<N extends number> = `${N}` extends `-${infer StringPositiveN}` ? StringToNumber<StringPositiveN> : N;
651
+ export type NumberAbsolute<N extends number> =
652
+ `${N}` extends `-${infer StringPositiveN}`
653
+ ? StringToNumber<StringPositiveN>
654
+ : N;
555
655
  /**
556
656
  Check whether the given type is a number or a number string.
557
657
 
@@ -571,7 +671,13 @@ type C = IsNumberLike<1>;
571
671
  type D = IsNumberLike<'a'>;
572
672
  //=> false
573
673
  */
574
- export type IsNumberLike<N> = N extends number ? true : N extends `${number}` ? true : N extends `${number}.${number}` ? true : false;
674
+ export type IsNumberLike<N> = N extends number
675
+ ? true
676
+ : N extends `${number}`
677
+ ? true
678
+ : N extends `${number}.${number}`
679
+ ? true
680
+ : false;
575
681
  /**
576
682
  Matches any primitive, `void`, `Date`, or `RegExp` value.
577
683
  */
@@ -579,7 +685,12 @@ export type BuiltIns = Primitive | void | Date | RegExp;
579
685
  /**
580
686
  Matches non-recursive types.
581
687
  */
582
- export type NonRecursiveType = BuiltIns | Function | (new (...arguments_: any[]) => unknown);
688
+ export type NonRecursiveType =
689
+ | BuiltIns
690
+ | Function
691
+ | (new (
692
+ ...arguments_: any[]
693
+ ) => unknown);
583
694
  /**
584
695
  Returns the sum of two numbers.
585
696
 
@@ -611,35 +722,45 @@ Sum<PositiveInfinity, NegativeInfinity>;
611
722
  @category Numeric
612
723
  */
613
724
  // TODO: Support big integer and negative number.
614
- export type Sum<A extends number, B extends number> = number extends A | B ? number : [
615
- IsEqual<A, PositiveInfinity>,
616
- IsEqual<A, NegativeInfinity>,
617
- IsEqual<B, PositiveInfinity>,
618
- IsEqual<B, NegativeInfinity>
619
- ] extends infer R extends [
620
- boolean,
621
- boolean,
622
- boolean,
623
- boolean
624
- ] ? Or<And<IsEqual<R[0], true>, IsEqual<R[3], false>>, And<IsEqual<R[2], true>, IsEqual<R[1], false>>> extends true ? PositiveInfinity : Or<And<IsEqual<R[1], true>, IsEqual<R[2], false>>, And<IsEqual<R[3], true>, IsEqual<R[0], false>>> extends true ? NegativeInfinity : true extends R[number] ? number : ([
625
- IsNegative<A>,
626
- IsNegative<B>
627
- ] extends infer R ? [
628
- false,
629
- false
630
- ] extends R ? [
631
- ...BuildTuple<A>,
632
- ...BuildTuple<B>
633
- ]["length"] : [
634
- true,
635
- true
636
- ] extends R ? number : TupleMax<[
637
- NumberAbsolute<A>,
638
- NumberAbsolute<B>
639
- ]> extends infer Max_ ? TupleMin<[
640
- NumberAbsolute<A>,
641
- NumberAbsolute<B>
642
- ]> extends infer Min_ extends number ? Max_ extends A | B ? Subtract<Max_, Min_> : number : never : never : never) & number : never;
725
+ export type Sum<A extends number, B extends number> = number extends A | B
726
+ ? number
727
+ : [
728
+ IsEqual<A, PositiveInfinity>,
729
+ IsEqual<A, NegativeInfinity>,
730
+ IsEqual<B, PositiveInfinity>,
731
+ IsEqual<B, NegativeInfinity>,
732
+ ] extends infer R extends [boolean, boolean, boolean, boolean]
733
+ ? Or<
734
+ And<IsEqual<R[0], true>, IsEqual<R[3], false>>,
735
+ And<IsEqual<R[2], true>, IsEqual<R[1], false>>
736
+ > extends true
737
+ ? PositiveInfinity
738
+ : Or<
739
+ And<IsEqual<R[1], true>, IsEqual<R[2], false>>,
740
+ And<IsEqual<R[3], true>, IsEqual<R[0], false>>
741
+ > extends true
742
+ ? NegativeInfinity
743
+ : true extends R[number]
744
+ ? number
745
+ : ([IsNegative<A>, IsNegative<B>] extends infer R
746
+ ? [false, false] extends R
747
+ ? [...BuildTuple<A>, ...BuildTuple<B>]['length']
748
+ : [true, true] extends R
749
+ ? number
750
+ : TupleMax<
751
+ [NumberAbsolute<A>, NumberAbsolute<B>]
752
+ > extends infer Max_
753
+ ? TupleMin<
754
+ [NumberAbsolute<A>, NumberAbsolute<B>]
755
+ > extends infer Min_ extends number
756
+ ? Max_ extends A | B
757
+ ? Subtract<Max_, Min_>
758
+ : number
759
+ : never
760
+ : never
761
+ : never) &
762
+ number
763
+ : never;
643
764
  /**
644
765
  Returns the difference between two numbers.
645
766
 
@@ -670,29 +791,40 @@ Subtract<PositiveInfinity, PositiveInfinity>;
670
791
  @category Numeric
671
792
  */
672
793
  // TODO: Support big integer and negative number.
673
- export type Subtract<A extends number, B extends number> = number extends A | B ? number : [
674
- IsEqual<A, PositiveInfinity>,
675
- IsEqual<A, NegativeInfinity>,
676
- IsEqual<B, PositiveInfinity>,
677
- IsEqual<B, NegativeInfinity>
678
- ] extends infer R extends [
679
- boolean,
680
- boolean,
681
- boolean,
682
- boolean
683
- ] ? Or<And<IsEqual<R[0], true>, IsEqual<R[2], false>>, And<IsEqual<R[3], true>, IsEqual<R[1], false>>> extends true ? PositiveInfinity : Or<And<IsEqual<R[1], true>, IsEqual<R[3], false>>, And<IsEqual<R[2], true>, IsEqual<R[0], false>>> extends true ? NegativeInfinity : true extends R[number] ? number : [
684
- IsNegative<A>,
685
- IsNegative<B>
686
- ] extends infer R ? [
687
- false,
688
- false
689
- ] extends R ? BuildTuple<A> extends infer R ? R extends [
690
- ...BuildTuple<B>,
691
- ...infer R
692
- ] ? R["length"] : number : never : LessThan<A, B> extends true ? number : [
693
- false,
694
- true
695
- ] extends R ? Sum<A, NumberAbsolute<B>> : Subtract<NumberAbsolute<B>, NumberAbsolute<A>> : never : never;
794
+ export type Subtract<A extends number, B extends number> = number extends A | B
795
+ ? number
796
+ : [
797
+ IsEqual<A, PositiveInfinity>,
798
+ IsEqual<A, NegativeInfinity>,
799
+ IsEqual<B, PositiveInfinity>,
800
+ IsEqual<B, NegativeInfinity>,
801
+ ] extends infer R extends [boolean, boolean, boolean, boolean]
802
+ ? Or<
803
+ And<IsEqual<R[0], true>, IsEqual<R[2], false>>,
804
+ And<IsEqual<R[3], true>, IsEqual<R[1], false>>
805
+ > extends true
806
+ ? PositiveInfinity
807
+ : Or<
808
+ And<IsEqual<R[1], true>, IsEqual<R[3], false>>,
809
+ And<IsEqual<R[2], true>, IsEqual<R[0], false>>
810
+ > extends true
811
+ ? NegativeInfinity
812
+ : true extends R[number]
813
+ ? number
814
+ : [IsNegative<A>, IsNegative<B>] extends infer R
815
+ ? [false, false] extends R
816
+ ? BuildTuple<A> extends infer R
817
+ ? R extends [...BuildTuple<B>, ...infer R]
818
+ ? R['length']
819
+ : number
820
+ : never
821
+ : LessThan<A, B> extends true
822
+ ? number
823
+ : [false, true] extends R
824
+ ? Sum<A, NumberAbsolute<B>>
825
+ : Subtract<NumberAbsolute<B>, NumberAbsolute<A>>
826
+ : never
827
+ : never;
696
828
  /**
697
829
  Paths options.
698
830
 
@@ -783,28 +915,85 @@ open('listB.1'); // TypeError. Because listB only has one element.
783
915
  @category Object
784
916
  @category Array
785
917
  */
786
- export type Paths<T, Options extends PathsOptions = {}> = _Paths<T, {
787
- // Set default maxRecursionDepth to 10
788
- maxRecursionDepth: Options["maxRecursionDepth"] extends number ? Options["maxRecursionDepth"] : DefaultPathsOptions["maxRecursionDepth"];
789
- // Set default bracketNotation to false
790
- bracketNotation: Options["bracketNotation"] extends boolean ? Options["bracketNotation"] : DefaultPathsOptions["bracketNotation"];
791
- }>;
792
- export type _Paths<T, Options extends Required<PathsOptions>> = T extends NonRecursiveType | ReadonlyMap<unknown, unknown> | ReadonlySet<unknown> ? never : IsAny<T> extends true ? never : T extends UnknownArray ? number extends T["length"] ? InternalPaths<StaticPartOfArray<T>, Options> | InternalPaths<Array<VariablePartOfArray<T>[number]>, Options> : InternalPaths<T, Options> : T extends object ? InternalPaths<T, Options> : never;
793
- export type InternalPaths<T, Options extends Required<PathsOptions>> = Options["maxRecursionDepth"] extends infer MaxDepth extends number ? Required<T> extends infer T ? T extends EmptyObject | readonly [
794
- ] ? never : {
795
- [Key in keyof T]: Key extends string | number // Limit `Key` to string or number.
796
- ? (Options["bracketNotation"] extends true ? IsNumberLike<Key> extends true ? `[${Key}]` : (Key | ToString<Key>) : never | Options["bracketNotation"] extends false ? (Key | ToString<Key>) : never) extends infer TranformedKey extends string | number ?
797
- // 1. If style is 'a[0].b' and 'Key' is a numberlike value like 3 or '3', transform 'Key' to `[${Key}]`, else to `${Key}` | Key
798
- // 2. If style is 'a.0.b', transform 'Key' to `${Key}` | Key
799
- TranformedKey | (
800
- // Recursively generate paths for the current key
801
- GreaterThan<MaxDepth, 0> extends true // Limit the depth to prevent infinite recursion
802
- ? _Paths<T[Key], {
803
- bracketNotation: Options["bracketNotation"];
804
- maxRecursionDepth: Subtract<MaxDepth, 1>;
805
- }> extends infer SubPath ? SubPath extends string | number ? (Options["bracketNotation"] extends true ? SubPath extends `[${any}]` | `[${any}]${string}` ? `${TranformedKey}${SubPath}` // If next node is number key like `[3]`, no need to add `.` before it.
806
- : `${TranformedKey}.${SubPath}` : never) | (Options["bracketNotation"] extends false ? `${TranformedKey}.${SubPath}` : never) : never : never : never) : never : never;
807
- }[keyof T & (T extends UnknownArray ? number : unknown)] : never : never;
918
+ export type Paths<T, Options extends PathsOptions = {}> = _Paths<
919
+ T,
920
+ {
921
+ // Set default maxRecursionDepth to 10
922
+ maxRecursionDepth: Options['maxRecursionDepth'] extends number
923
+ ? Options['maxRecursionDepth']
924
+ : DefaultPathsOptions['maxRecursionDepth'];
925
+ // Set default bracketNotation to false
926
+ bracketNotation: Options['bracketNotation'] extends boolean
927
+ ? Options['bracketNotation']
928
+ : DefaultPathsOptions['bracketNotation'];
929
+ }
930
+ >;
931
+ export type _Paths<T, Options extends Required<PathsOptions>> = T extends
932
+ | NonRecursiveType
933
+ | ReadonlyMap<unknown, unknown>
934
+ | ReadonlySet<unknown>
935
+ ? never
936
+ : IsAny<T> extends true
937
+ ? never
938
+ : T extends UnknownArray
939
+ ? number extends T['length']
940
+ ?
941
+ | InternalPaths<StaticPartOfArray<T>, Options>
942
+ | InternalPaths<Array<VariablePartOfArray<T>[number]>, Options>
943
+ : InternalPaths<T, Options>
944
+ : T extends object
945
+ ? InternalPaths<T, Options>
946
+ : never;
947
+ export type InternalPaths<
948
+ T,
949
+ Options extends Required<PathsOptions>,
950
+ > = Options['maxRecursionDepth'] extends infer MaxDepth extends number
951
+ ? Required<T> extends infer T
952
+ ? T extends EmptyObject | readonly []
953
+ ? never
954
+ : {
955
+ [Key in keyof T]: Key extends string | number // Limit `Key` to string or number.
956
+ ? (
957
+ Options['bracketNotation'] extends true
958
+ ? IsNumberLike<Key> extends true
959
+ ? `[${Key}]`
960
+ : Key | ToString<Key>
961
+ : never | Options['bracketNotation'] extends false
962
+ ? Key | ToString<Key>
963
+ : never
964
+ ) extends infer TranformedKey extends string | number
965
+ ? // 1. If style is 'a[0].b' and 'Key' is a numberlike value like 3 or '3', transform 'Key' to `[${Key}]`, else to `${Key}` | Key
966
+ // 2. If style is 'a.0.b', transform 'Key' to `${Key}` | Key
967
+ | TranformedKey
968
+ // Recursively generate paths for the current key
969
+ | (GreaterThan<MaxDepth, 0> extends true // Limit the depth to prevent infinite recursion
970
+ ? _Paths<
971
+ T[Key],
972
+ {
973
+ bracketNotation: Options['bracketNotation'];
974
+ maxRecursionDepth: Subtract<MaxDepth, 1>;
975
+ }
976
+ > extends infer SubPath
977
+ ? SubPath extends string | number
978
+ ?
979
+ | (Options['bracketNotation'] extends true
980
+ ? SubPath extends
981
+ | `[${any}]`
982
+ | `[${any}]${string}`
983
+ ? `${TranformedKey}${SubPath}` // If next node is number key like `[3]`, no need to add `.` before it.
984
+ : `${TranformedKey}.${SubPath}`
985
+ : never)
986
+ | (Options['bracketNotation'] extends false
987
+ ? `${TranformedKey}.${SubPath}`
988
+ : never)
989
+ : never
990
+ : never
991
+ : never)
992
+ : never
993
+ : never;
994
+ }[keyof T & (T extends UnknownArray ? number : unknown)]
995
+ : never
996
+ : never;
808
997
  export type LiteralStringUnion<T> = LiteralUnion<T, string>;
809
998
  /**
810
999
  Allows creating a union type by combining primitive types and literal types without sacrificing auto-completion in IDEs for the literal type part of the union.
@@ -835,7 +1024,9 @@ const pet: Pet2 = '';
835
1024
 
836
1025
  @category Type
837
1026
  */
838
- export type LiteralUnion<LiteralType, BaseType extends Primitive> = LiteralType | (BaseType & Record<never, never>);
1027
+ export type LiteralUnion<LiteralType, BaseType extends Primitive> =
1028
+ | LiteralType
1029
+ | (BaseType & Record<never, never>);
839
1030
  /**
840
1031
  Get keys of the given type as strings.
841
1032
 
@@ -860,7 +1051,8 @@ type StringKeysOfFoo = StringKeyOf<Foo>;
860
1051
 
861
1052
  @category Object
862
1053
  */
863
- export type StringKeyOf<BaseType> = `${Extract<keyof BaseType, string | number>}`;
1054
+ export type StringKeyOf<BaseType> =
1055
+ `${Extract<keyof BaseType, string | number>}`;
864
1056
  /**
865
1057
  Represents an array of strings split using a given character or character set.
866
1058
 
@@ -882,13 +1074,14 @@ array = split(items, ',');
882
1074
  @category String
883
1075
  @category Template literal
884
1076
  */
885
- export type Split<S extends string, Delimiter extends string> = S extends `${infer Head}${Delimiter}${infer Tail}` ? [
886
- Head,
887
- ...Split<Tail, Delimiter>
888
- ] : S extends Delimiter ? [
889
- ] : [
890
- S
891
- ];
1077
+ export type Split<
1078
+ S extends string,
1079
+ Delimiter extends string,
1080
+ > = S extends `${infer Head}${Delimiter}${infer Tail}`
1081
+ ? [Head, ...Split<Tail, Delimiter>]
1082
+ : S extends Delimiter
1083
+ ? []
1084
+ : [S];
892
1085
  export type GetOptions = {
893
1086
  /**
894
1087
  Include `undefined` in the return type when accessing properties.
@@ -902,24 +1095,41 @@ export type GetOptions = {
902
1095
  /**
903
1096
  Like the `Get` type but receives an array of strings as a path parameter.
904
1097
  */
905
- export type GetWithPath<BaseType, Keys, Options extends GetOptions = {}> = Keys extends readonly [
906
- ] ? BaseType : Keys extends readonly [
907
- infer Head,
908
- ...infer Tail
909
- ] ? GetWithPath<PropertyOf<BaseType, Extract<Head, string>, Options>, Extract<Tail, string[]>, Options> : never;
1098
+ export type GetWithPath<
1099
+ BaseType,
1100
+ Keys,
1101
+ Options extends GetOptions = {},
1102
+ > = Keys extends readonly []
1103
+ ? BaseType
1104
+ : Keys extends readonly [infer Head, ...infer Tail]
1105
+ ? GetWithPath<
1106
+ PropertyOf<BaseType, Extract<Head, string>, Options>,
1107
+ Extract<Tail, string[]>,
1108
+ Options
1109
+ >
1110
+ : never;
910
1111
  /**
911
1112
  Adds `undefined` to `Type` if `strict` is enabled.
912
1113
  */
913
- export type Strictify<Type, Options extends GetOptions> = Options["strict"] extends false ? Type : (Type | undefined);
1114
+ export type Strictify<
1115
+ Type,
1116
+ Options extends GetOptions,
1117
+ > = Options['strict'] extends false ? Type : Type | undefined;
914
1118
  /**
915
1119
  If `Options['strict']` is `true`, includes `undefined` in the returned type when accessing properties on `Record<string, any>`.
916
1120
 
917
1121
  Known limitations:
918
1122
  - Does not include `undefined` in the type on object types with an index signature (for example, `{a: string; [key: string]: string}`).
919
1123
  */
920
- export type StrictPropertyOf<BaseType, Key extends keyof BaseType, Options extends GetOptions> = Record<string, any> extends BaseType ? string extends keyof BaseType ? Strictify<BaseType[Key], Options> // Record<string, any>
921
- : BaseType[Key] // Record<'a' | 'b', any> (Records with a string union as keys have required properties)
922
- : BaseType[Key];
1124
+ export type StrictPropertyOf<
1125
+ BaseType,
1126
+ Key extends keyof BaseType,
1127
+ Options extends GetOptions,
1128
+ > = Record<string, any> extends BaseType
1129
+ ? string extends keyof BaseType
1130
+ ? Strictify<BaseType[Key], Options> // Record<string, any>
1131
+ : BaseType[Key] // Record<'a' | 'b', any> (Records with a string union as keys have required properties)
1132
+ : BaseType[Key];
923
1133
  /**
924
1134
  Splits a dot-prop style path into a tuple comprised of the properties in the path. Handles square-bracket notation.
925
1135
 
@@ -932,11 +1142,18 @@ ToPath<'foo[0].bar.baz'>
932
1142
  //=> ['foo', '0', 'bar', 'baz']
933
1143
  ```
934
1144
  */
935
- export type ToPath<S extends string> = Split<FixPathSquareBrackets<S>, ".">;
1145
+ export type ToPath<S extends string> = Split<FixPathSquareBrackets<S>, '.'>;
936
1146
  /**
937
1147
  Replaces square-bracketed dot notation with dots, for example, `foo[0].bar` -> `foo.0.bar`.
938
1148
  */
939
- export type FixPathSquareBrackets<Path extends string> = Path extends `[${infer Head}]${infer Tail}` ? Tail extends `[${string}` ? `${Head}.${FixPathSquareBrackets<Tail>}` : `${Head}${FixPathSquareBrackets<Tail>}` : Path extends `${infer Head}[${infer Middle}]${infer Tail}` ? `${Head}.${FixPathSquareBrackets<`[${Middle}]${Tail}`>}` : Path;
1149
+ export type FixPathSquareBrackets<Path extends string> =
1150
+ Path extends `[${infer Head}]${infer Tail}`
1151
+ ? Tail extends `[${string}`
1152
+ ? `${Head}.${FixPathSquareBrackets<Tail>}`
1153
+ : `${Head}${FixPathSquareBrackets<Tail>}`
1154
+ : Path extends `${infer Head}[${infer Middle}]${infer Tail}`
1155
+ ? `${Head}.${FixPathSquareBrackets<`[${Middle}]${Tail}`>}`
1156
+ : Path;
940
1157
  /**
941
1158
  Returns true if `LongString` is made up out of `Substring` repeated 0 or more times.
942
1159
 
@@ -948,7 +1165,14 @@ ConsistsOnlyOf<'aBa', 'a'> //=> false
948
1165
  ConsistsOnlyOf<'', 'a'> //=> true
949
1166
  ```
950
1167
  */
951
- export type ConsistsOnlyOf<LongString extends string, Substring extends string> = LongString extends "" ? true : LongString extends `${Substring}${infer Tail}` ? ConsistsOnlyOf<Tail, Substring> : false;
1168
+ export type ConsistsOnlyOf<
1169
+ LongString extends string,
1170
+ Substring extends string,
1171
+ > = LongString extends ''
1172
+ ? true
1173
+ : LongString extends `${Substring}${infer Tail}`
1174
+ ? ConsistsOnlyOf<Tail, Substring>
1175
+ : false;
952
1176
  /**
953
1177
  Convert a type which may have number keys to one with string keys, making it possible to index using strings retrieved from template types.
954
1178
 
@@ -969,11 +1193,11 @@ export type WithStringKeys<BaseType> = {
969
1193
  /**
970
1194
  Perform a `T[U]` operation if `T` supports indexing.
971
1195
  */
972
- export type UncheckedIndex<T, U extends string | number> = [
973
- T
974
- ] extends [
975
- Record<string | number, any>
976
- ] ? T[U] : never;
1196
+ export type UncheckedIndex<T, U extends string | number> = [T] extends [
1197
+ Record<string | number, any>,
1198
+ ]
1199
+ ? T[U]
1200
+ : never;
977
1201
  /**
978
1202
  Get a property of an object or array. Works when indexing arrays using number-literal-strings, for example, `PropertyOf<number[], '0'> = number`, and when indexing objects with number keys.
979
1203
 
@@ -981,15 +1205,26 @@ Note:
981
1205
  - Returns `unknown` if `Key` is not a property of `BaseType`, since TypeScript uses structural typing, and it cannot be guaranteed that extra properties unknown to the type system will exist at runtime.
982
1206
  - Returns `undefined` from nullish values, to match the behaviour of most deep-key libraries like `lodash`, `dot-prop`, etc.
983
1207
  */
984
- export type PropertyOf<BaseType, Key extends string, Options extends GetOptions = {}> = BaseType extends null | undefined ? undefined : Key extends keyof BaseType ? StrictPropertyOf<BaseType, Key, Options> : BaseType extends readonly [
985
- ] | readonly [
986
- unknown,
987
- ...unknown[]
988
- ] ? unknown // It's a tuple, but `Key` did not extend `keyof BaseType`. So the index is out of bounds.
989
- : BaseType extends {
990
- [n: number]: infer Item;
991
- length: number; // Note: This is needed to avoid being too lax with records types using number keys like `{0: string; 1: boolean}`.
992
- } ? (ConsistsOnlyOf<Key, StringDigit> extends true ? Strictify<Item, Options> : unknown) : Key extends keyof WithStringKeys<BaseType> ? StrictPropertyOf<WithStringKeys<BaseType>, Key, Options> : unknown;
1208
+ export type PropertyOf<
1209
+ BaseType,
1210
+ Key extends string,
1211
+ Options extends GetOptions = {},
1212
+ > = BaseType extends null | undefined
1213
+ ? undefined
1214
+ : Key extends keyof BaseType
1215
+ ? StrictPropertyOf<BaseType, Key, Options>
1216
+ : BaseType extends readonly [] | readonly [unknown, ...unknown[]]
1217
+ ? unknown // It's a tuple, but `Key` did not extend `keyof BaseType`. So the index is out of bounds.
1218
+ : BaseType extends {
1219
+ [n: number]: infer Item;
1220
+ length: number; // Note: This is needed to avoid being too lax with records types using number keys like `{0: string; 1: boolean}`.
1221
+ }
1222
+ ? ConsistsOnlyOf<Key, StringDigit> extends true
1223
+ ? Strictify<Item, Options>
1224
+ : unknown
1225
+ : Key extends keyof WithStringKeys<BaseType>
1226
+ ? StrictPropertyOf<WithStringKeys<BaseType>, Key, Options>
1227
+ : unknown;
993
1228
  // This works by first splitting the path based on `.` and `[...]` characters into a tuple of string keys. Then it recursively uses the head key to get the next property of the current object, until there are no keys left. Number keys extract the item type from arrays, or are converted to strings to extract types from tuples and dictionaries with number keys.
994
1229
  /**
995
1230
  Get a deeply-nested property from an object using a key path, like Lodash's `.get()` function.
@@ -1037,24 +1272,48 @@ Get<Record<string, string>, 'foo', {strict: true}> // => string
1037
1272
  @category Array
1038
1273
  @category Template literal
1039
1274
  */
1040
- export type Get<BaseType, Path extends readonly string[] | LiteralStringUnion<ToString<Paths<BaseType, {
1041
- bracketNotation: false;
1042
- }> | Paths<BaseType, {
1043
- bracketNotation: true;
1044
- }>>>, Options extends GetOptions = {}> = GetWithPath<BaseType, Path extends string ? ToPath<Path> : Path, Options>;
1045
- export type PlainObject = UnknownRecord;
1275
+ export type Get<
1276
+ BaseType,
1277
+ Path extends
1278
+ | readonly string[]
1279
+ | LiteralStringUnion<
1280
+ ToString<
1281
+ | Paths<
1282
+ BaseType,
1283
+ {
1284
+ bracketNotation: false;
1285
+ }
1286
+ >
1287
+ | Paths<
1288
+ BaseType,
1289
+ {
1290
+ bracketNotation: true;
1291
+ }
1292
+ >
1293
+ >
1294
+ >,
1295
+ Options extends GetOptions = {},
1296
+ > = GetWithPath<BaseType, Path extends string ? ToPath<Path> : Path, Options>;
1297
+ export type ArrayOrPlainObject = UnknownArray | UnknownRecord;
1046
1298
  /**
1047
1299
  * - Get the value from an object using a known path
1048
1300
  * - You can retrieve a nested value by using dot notation, e.g., `foo.bar.baz`
1049
1301
  * - Returns `undefined` if the value is not found
1050
1302
  */
1051
- export declare function getValue<Data extends PlainObject, Path extends Paths<Data>>(data: Data, path: Path): Get<Data, ToString<Path>>;
1303
+ export declare function getValue<
1304
+ Data extends ArrayOrPlainObject,
1305
+ Path extends Paths<Data>,
1306
+ >(data: Data, path: Path): Get<Data, ToString<Path>>;
1052
1307
  /**
1053
1308
  * - Get the value from an object using an unknown path
1054
1309
  * - You can retrieve a nested value by using dot notation, e.g., `foo.bar.baz`
1055
1310
  * - If `ignoreCase` is `true`, path matching will be case-insensitive
1056
1311
  * - Returns `undefined` if the value is not found
1057
1312
  */
1058
- export declare function getValue<Data extends PlainObject>(data: Data, path: string, ignoreCase?: boolean): unknown;
1313
+ export declare function getValue<Data extends ArrayOrPlainObject>(
1314
+ data: Data,
1315
+ path: string,
1316
+ ignoreCase?: boolean,
1317
+ ): unknown;
1059
1318
 
1060
1319
  export {};