type-plus 6.0.0 → 6.1.0
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/README.md +24 -10
- package/cjs/any_plus/any.d.ts +29 -0
- package/cjs/any_plus/any.d.ts.map +1 -0
- package/cjs/{number_plus/_plus.js → any_plus/any.js} +1 -1
- package/cjs/any_plus/any.js.map +1 -0
- package/cjs/any_plus/index.d.ts +2 -0
- package/cjs/any_plus/index.d.ts.map +1 -0
- package/cjs/{predicates/IsAny.js → any_plus/index.js} +1 -1
- package/cjs/any_plus/index.js.map +1 -0
- package/cjs/array_plus/array.d.ts +16 -5
- package/cjs/array_plus/array.d.ts.map +1 -1
- package/cjs/array_plus/array_plus.d.ts +35 -0
- package/cjs/array_plus/array_plus.d.ts.map +1 -0
- package/cjs/array_plus/{_plus.js → array_plus.js} +1 -1
- package/cjs/array_plus/array_plus.js.map +1 -0
- package/cjs/array_plus/create_tuple.d.ts +1 -1
- package/cjs/array_plus/create_tuple.d.ts.map +1 -1
- package/cjs/array_plus/index.d.ts +15 -15
- package/cjs/array_plus/index.d.ts.map +1 -1
- package/cjs/array_plus/pad_left.d.ts +4 -3
- package/cjs/array_plus/pad_left.d.ts.map +1 -1
- package/cjs/array_plus/tail.d.ts +1 -1
- package/cjs/array_plus/tail.d.ts.map +1 -1
- package/cjs/assertion/assertType.d.ts +1 -1
- package/cjs/assertion/assertType.d.ts.map +1 -1
- package/cjs/assertion/assertType.js.map +1 -1
- package/cjs/index.d.ts +3 -2
- package/cjs/index.d.ts.map +1 -1
- package/cjs/index.js +6 -5
- package/cjs/index.js.map +1 -1
- package/cjs/math/Max.d.ts +1 -1
- package/cjs/math/Max.d.ts.map +1 -1
- package/cjs/number_plus/number.d.ts +13 -0
- package/cjs/number_plus/number.d.ts.map +1 -1
- package/cjs/number_plus/number_plus.d.ts +2 -0
- package/cjs/number_plus/number_plus.d.ts.map +1 -0
- package/cjs/number_plus/number_plus.js +3 -0
- package/cjs/number_plus/number_plus.js.map +1 -0
- package/cjs/object/IsDisjoint.d.ts +2 -2
- package/cjs/object/IsDisjoint.d.ts.map +1 -1
- package/cjs/object/KeysWithDiffType.d.ts +1 -1
- package/cjs/object/KeysWithDiffType.d.ts.map +1 -1
- package/cjs/object/KnownKeys.d.ts +1 -1
- package/cjs/object/KnownKeys.d.ts.map +1 -1
- package/cjs/object/OptionalKeys.d.ts +1 -1
- package/cjs/object/OptionalKeys.d.ts.map +1 -1
- package/cjs/object/Partial.d.ts +3 -3
- package/cjs/object/Partial.d.ts.map +1 -1
- package/cjs/object/getField.d.ts +1 -1
- package/cjs/object/getField.d.ts.map +1 -1
- package/cjs/object/mapKey.d.ts +1 -1
- package/cjs/object/mapKey.d.ts.map +1 -1
- package/cjs/object/mapProperties.d.ts +1 -1
- package/cjs/object/mapProperties.d.ts.map +1 -1
- package/cjs/object/omit.d.ts +3 -3
- package/cjs/object/omit.d.ts.map +1 -1
- package/cjs/object/omit.js +2 -2
- package/cjs/object/omit.js.map +1 -1
- package/cjs/object/pick.d.ts +1 -1
- package/cjs/object/pick.d.ts.map +1 -1
- package/cjs/predicates/Equal.d.ts +1 -1
- package/cjs/predicates/Equal.d.ts.map +1 -1
- package/cjs/predicates/index.d.ts +0 -1
- package/cjs/predicates/index.d.ts.map +1 -1
- package/cjs/predicates/index.js.map +1 -1
- package/cjs/promise/PromiseValueMerge.d.ts +1 -2
- package/cjs/promise/PromiseValueMerge.d.ts.map +1 -1
- package/esm/any_plus/any.d.ts +29 -0
- package/esm/any_plus/any.d.ts.map +1 -0
- package/esm/any_plus/any.js +2 -0
- package/esm/any_plus/any.js.map +1 -0
- package/esm/any_plus/index.d.ts +2 -0
- package/esm/any_plus/index.d.ts.map +1 -0
- package/esm/any_plus/index.js +2 -0
- package/esm/any_plus/index.js.map +1 -0
- package/esm/array_plus/array.d.ts +16 -5
- package/esm/array_plus/array.d.ts.map +1 -1
- package/esm/array_plus/array_plus.d.ts +35 -0
- package/esm/array_plus/array_plus.d.ts.map +1 -0
- package/esm/array_plus/array_plus.js +2 -0
- package/esm/array_plus/array_plus.js.map +1 -0
- package/esm/array_plus/create_tuple.d.ts +1 -1
- package/esm/array_plus/create_tuple.d.ts.map +1 -1
- package/esm/array_plus/index.d.ts +15 -15
- package/esm/array_plus/index.d.ts.map +1 -1
- package/esm/array_plus/pad_left.d.ts +4 -3
- package/esm/array_plus/pad_left.d.ts.map +1 -1
- package/esm/array_plus/tail.d.ts +1 -1
- package/esm/array_plus/tail.d.ts.map +1 -1
- package/esm/assertion/assertType.d.ts +1 -1
- package/esm/assertion/assertType.d.ts.map +1 -1
- package/esm/assertion/assertType.js.map +1 -1
- package/esm/index.d.ts +3 -2
- package/esm/index.d.ts.map +1 -1
- package/esm/index.js +3 -2
- package/esm/index.js.map +1 -1
- package/esm/math/Max.d.ts +1 -1
- package/esm/math/Max.d.ts.map +1 -1
- package/esm/number_plus/number.d.ts +13 -0
- package/esm/number_plus/number.d.ts.map +1 -1
- package/esm/number_plus/number_plus.d.ts +2 -0
- package/esm/number_plus/number_plus.d.ts.map +1 -0
- package/esm/number_plus/number_plus.js +2 -0
- package/esm/number_plus/number_plus.js.map +1 -0
- package/esm/object/IsDisjoint.d.ts +2 -2
- package/esm/object/IsDisjoint.d.ts.map +1 -1
- package/esm/object/KeysWithDiffType.d.ts +1 -1
- package/esm/object/KeysWithDiffType.d.ts.map +1 -1
- package/esm/object/KnownKeys.d.ts +1 -1
- package/esm/object/KnownKeys.d.ts.map +1 -1
- package/esm/object/OptionalKeys.d.ts +1 -1
- package/esm/object/OptionalKeys.d.ts.map +1 -1
- package/esm/object/Partial.d.ts +3 -3
- package/esm/object/Partial.d.ts.map +1 -1
- package/esm/object/getField.d.ts +1 -1
- package/esm/object/getField.d.ts.map +1 -1
- package/esm/object/mapKey.d.ts +1 -1
- package/esm/object/mapKey.d.ts.map +1 -1
- package/esm/object/mapProperties.d.ts +1 -1
- package/esm/object/mapProperties.d.ts.map +1 -1
- package/esm/object/omit.d.ts +3 -3
- package/esm/object/omit.d.ts.map +1 -1
- package/esm/object/omit.js +1 -1
- package/esm/object/omit.js.map +1 -1
- package/esm/object/pick.d.ts +1 -1
- package/esm/object/pick.d.ts.map +1 -1
- package/esm/predicates/Equal.d.ts +1 -1
- package/esm/predicates/Equal.d.ts.map +1 -1
- package/esm/predicates/index.d.ts +0 -1
- package/esm/predicates/index.d.ts.map +1 -1
- package/esm/predicates/index.js.map +1 -1
- package/esm/promise/PromiseValueMerge.d.ts +1 -2
- package/esm/promise/PromiseValueMerge.d.ts.map +1 -1
- package/package.json +3 -3
- package/ts/any_plus/any.ts +29 -0
- package/ts/any_plus/index.ts +1 -0
- package/ts/array_plus/array.ts +21 -11
- package/ts/array_plus/array_plus.ts +66 -0
- package/ts/array_plus/create_tuple.ts +1 -1
- package/ts/array_plus/index.ts +15 -15
- package/ts/array_plus/pad_left.ts +4 -3
- package/ts/array_plus/tail.ts +1 -1
- package/ts/assertion/assertType.ts +1 -1
- package/ts/index.ts +3 -2
- package/ts/math/Max.ts +1 -1
- package/ts/number_plus/number.ts +14 -0
- package/ts/object/IsDisjoint.ts +2 -2
- package/ts/object/KeysWithDiffType.ts +1 -1
- package/ts/object/KnownKeys.ts +1 -1
- package/ts/object/OptionalKeys.ts +1 -1
- package/ts/object/Partial.ts +3 -3
- package/ts/object/getField.ts +1 -1
- package/ts/object/mapKey.ts +1 -1
- package/ts/object/mapProperties.ts +1 -1
- package/ts/object/omit.ts +4 -3
- package/ts/object/pick.ts +1 -1
- package/ts/predicates/Equal.ts +1 -1
- package/ts/predicates/index.ts +0 -1
- package/ts/promise/PromiseValueMerge.ts +9 -11
- package/cjs/array_plus/_plus.d.ts +0 -2
- package/cjs/array_plus/_plus.d.ts.map +0 -1
- package/cjs/array_plus/_plus.js.map +0 -1
- package/cjs/number_plus/_plus.d.ts +0 -2
- package/cjs/number_plus/_plus.d.ts.map +0 -1
- package/cjs/number_plus/_plus.js.map +0 -1
- package/cjs/predicates/IsAny.d.ts +0 -3
- package/cjs/predicates/IsAny.d.ts.map +0 -1
- package/cjs/predicates/IsAny.js.map +0 -1
- package/esm/array_plus/_plus.d.ts +0 -2
- package/esm/array_plus/_plus.d.ts.map +0 -1
- package/esm/array_plus/_plus.js +0 -2
- package/esm/array_plus/_plus.js.map +0 -1
- package/esm/number_plus/_plus.d.ts +0 -2
- package/esm/number_plus/_plus.d.ts.map +0 -1
- package/esm/number_plus/_plus.js +0 -2
- package/esm/number_plus/_plus.js.map +0 -1
- package/esm/predicates/IsAny.d.ts +0 -3
- package/esm/predicates/IsAny.d.ts.map +0 -1
- package/esm/predicates/IsAny.js +0 -2
- package/esm/predicates/IsAny.js.map +0 -1
- package/ts/array_plus/_plus.ts +0 -1
- package/ts/predicates/IsAny.ts +0 -3
- /package/ts/number_plus/{_plus.ts → number_plus.ts} +0 -0
package/README.md
CHANGED
|
@@ -313,9 +313,14 @@ type Yes = IsAny<any, 'yes', 'no'> // 'yes'
|
|
|
313
313
|
type No = IsAny<1, 'yes', 'no'> // 'no'
|
|
314
314
|
```
|
|
315
315
|
|
|
316
|
-
###
|
|
316
|
+
### Any
|
|
317
317
|
|
|
318
|
-
- [`
|
|
318
|
+
- [`AnyType<T, Then = T, Else = never>`]: `T === any`.
|
|
319
|
+
- [`IsAny<T, Then = true, Else = false>`]: `T === any` (origin: [ts-essentials]).
|
|
320
|
+
|
|
321
|
+
### Array
|
|
322
|
+
|
|
323
|
+
- [`At<A, N, Fail = never>`](ts/array_plus/array.ts#L19): gets the element type at index `N` in the array `A`.
|
|
319
324
|
- `CommonPropKeys<A>`: gets common keys inside the records in the array `A` (deprecate `CommonKeys`).
|
|
320
325
|
- [`Concat<A, B>`](ts/array_plus/array.ts#L38): `[...A, ...B]`.
|
|
321
326
|
- `CreateTuple<L, T>`: Creates `Tuple<T>` with `L` number of elements.
|
|
@@ -341,6 +346,9 @@ type No = IsAny<1, 'yes', 'no'> // 'no'
|
|
|
341
346
|
- `Tail<A>`: Gets the types of a tuple except the first entry.
|
|
342
347
|
- `UnionOfProps<A, K>`: gets the union of `A[K]` types (deprecate `PropUnion`).
|
|
343
348
|
- `UnionOfValues<A>`: gets the union of value types in `A` (deprecate `ArrayValue`).
|
|
349
|
+
- [`ArrayPlus.IndexAt<A, N, Fail = never>`](ts/array_plus/array_plus.ts#L23): gets the normalized index for `A`.
|
|
350
|
+
- [`ArrayPlus.IsIndexOutOfBound<A, N, Then = true, Else = false>`](ts/array_plus/array_plus.ts#L62): Is `N` an out of bound index of `A`. Supports negative numbers.
|
|
351
|
+
- [`ArrayType<T, Then = N, Else = never>`](ts/array_plus/array.ts#L48): Is the type `T` exactly an array and not a tuple.
|
|
344
352
|
|
|
345
353
|
### Constant Types
|
|
346
354
|
|
|
@@ -430,7 +438,7 @@ Type predicates are type alias that returns `true` or `false`.
|
|
|
430
438
|
They can be used to compose complex types.
|
|
431
439
|
|
|
432
440
|
- `HasKey<T, K>`: predicate type checking `T` has key `K`.
|
|
433
|
-
- `IsAny<T>`: `T === any
|
|
441
|
+
- `IsAny<T>`: `T === any` (updated to impl: [expect-type]).
|
|
434
442
|
- `IsBoolean<T>`: check for `boolean`, but not for `true` nor `false`.
|
|
435
443
|
- `IsDisjoint<A, B>`: is `A` and `B` is a disjoint set.
|
|
436
444
|
- `IsEmptyObject<T>`: is `T === {}`.
|
|
@@ -455,11 +463,12 @@ So you may encounter some weird behavior if your logic is complex.
|
|
|
455
463
|
|
|
456
464
|
### Number
|
|
457
465
|
|
|
458
|
-
- [`Numeric`](ts/number_plus/number.ts#L4): either number or bigint (origin: [type-
|
|
459
|
-
- [`Zero`](ts/number_plus/number.ts#L9): `0` in number or bigint (origin: [type-
|
|
460
|
-
- [`Integer<N, Then = N, Else = never>`](ts/number_plus/number.ts#L24): is integer (origin: [type-
|
|
461
|
-
- [`Negative<N, Then = N, Else = never>`](ts/number_plus/number.ts#39): is negative (origin: [type-
|
|
462
|
-
- [`NonNegative<N, Then = N, Else = never>`](ts/number_plus/number.ts#58): is non-negative (origin: [type-
|
|
466
|
+
- [`Numeric`](ts/number_plus/number.ts#L4): either `number` or `bigint` (origin: [type-fest]).
|
|
467
|
+
- [`Zero`](ts/number_plus/number.ts#L9): `0` in `number` or `bigint` (origin: [type-fest]).
|
|
468
|
+
- [`Integer<N, Then = N, Else = never>`](ts/number_plus/number.ts#L24): is integer (origin: [type-fest]).
|
|
469
|
+
- [`Negative<N, Then = N, Else = never>`](ts/number_plus/number.ts#39): is negative (origin: [type-fest]).
|
|
470
|
+
- [`NonNegative<N, Then = N, Else = never>`](ts/number_plus/number.ts#58): is non-negative (origin: [type-fest])
|
|
471
|
+
- [`NumberType<T, Then = N, Else = never>`](ts/number_plus/number.ts#L65): Is the type `T` exactly `number`.
|
|
463
472
|
|
|
464
473
|
### Math
|
|
465
474
|
|
|
@@ -639,6 +648,7 @@ git push
|
|
|
639
648
|
```
|
|
640
649
|
|
|
641
650
|
[@gcanti]: https://github.com/gcanti
|
|
651
|
+
[assertion_function]: https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-7.html#assertion-functions
|
|
642
652
|
[codecov-image]: https://codecov.io/gh/unional/type-plus/branch/master/graph/badge.svg
|
|
643
653
|
[codecov-url]: https://codecov.io/gh/unional/type-plus
|
|
644
654
|
[downloads-image]: https://img.shields.io/npm/dm/type-plus.svg?style=flat
|
|
@@ -650,10 +660,15 @@ git push
|
|
|
650
660
|
[npm-url]: https://npmjs.org/package/type-plus
|
|
651
661
|
[semantic-release-image]: https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg
|
|
652
662
|
[semantic-release-url]: https://github.com/semantic-release/semantic-release
|
|
663
|
+
[spec.ts]: https://github.com/aleclarson/spec.ts
|
|
664
|
+
[ts-essentials]: https://github.com/ts-essentials/ts-essentials
|
|
653
665
|
[ts-expect]: https://github.com/TypeStrong/ts-expect
|
|
654
|
-
[
|
|
666
|
+
[ts-toolbelt]: https://github.com/millsp/ts-toolbelt
|
|
655
667
|
[type_guard]: https://www.typescriptlang.org/docs/handbook/2/narrowing.html#using-type-predicates
|
|
668
|
+
[type-fest]: https://github.com/sindresorhus/type-fest
|
|
669
|
+
[type-zoo]: https://github.com/pelotom/type-zoo
|
|
656
670
|
[typelevel-ts]: https://github.com/gcanti/typelevel-ts
|
|
671
|
+
[typepark]: https://github.com/kgtkr/typepark
|
|
657
672
|
[TypeScript]: https://www.typescriptlang.org
|
|
658
673
|
[typical]: https://github.com/KiaraGrouwstra/typical
|
|
659
674
|
[utility-types]: https://github.com/piotrwitek/utility-types
|
|
@@ -661,4 +676,3 @@ git push
|
|
|
661
676
|
[vscode-url]: https://code.visualstudio.com/
|
|
662
677
|
[wallaby-image]: https://img.shields.io/badge/wallaby.js-configured-green.svg
|
|
663
678
|
[wallaby-url]: https://wallabyjs.com
|
|
664
|
-
[assertion_function]: https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-7.html#assertion-functions
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Is the type `T` exactly `any`.
|
|
3
|
+
*
|
|
4
|
+
* ```
|
|
5
|
+
* import type { IsAny } from 'type-plus'
|
|
6
|
+
*
|
|
7
|
+
* type R = IsAny<any> // true
|
|
8
|
+
*
|
|
9
|
+
* type R = IsAny<never> // false
|
|
10
|
+
* type R = IsAny<unknown> // false
|
|
11
|
+
* type R = IsAny<string | boolean> // false
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
export type IsAny<T, Then = true, Else = false> = 0 extends 1 & T ? Then : Else;
|
|
15
|
+
/**
|
|
16
|
+
* Check if the type `T` is exactly `any`.
|
|
17
|
+
*
|
|
18
|
+
* ```
|
|
19
|
+
* import type { AnyType } from 'type-plus'
|
|
20
|
+
*
|
|
21
|
+
* type R = AnyType<any> // any
|
|
22
|
+
*
|
|
23
|
+
* type R = AnyType<never> // never
|
|
24
|
+
* type R = AnyType<unknown> // never
|
|
25
|
+
* type R = AnyType<string | boolean> // never
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
export type AnyType<T, Then = T, Else = never> = IsAny<T, Then, Else>;
|
|
29
|
+
//# sourceMappingURL=any.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"any.d.ts","sourceRoot":"","sources":["../../ts/any_plus/any.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,KAAK,CAAC,CAAC,EAAE,IAAI,GAAG,IAAI,EAAE,IAAI,GAAG,KAAK,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,IAAI,GAAG,IAAI,CAAA;AAE/E;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,OAAO,CAAC,CAAC,EAAE,IAAI,GAAG,CAAC,EAAE,IAAI,GAAG,KAAK,IAAI,KAAK,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"any.js","sourceRoot":"","sources":["../../ts/any_plus/any.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../ts/any_plus/index.ts"],"names":[],"mappings":"AAAA,mBAAmB,UAAU,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../ts/any_plus/index.ts"],"names":[],"mappings":""}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
3
|
-
import type { Subtract } from '../math/Subtract.js';
|
|
4
|
-
import type { Negative } from '../number_plus/number.js';
|
|
1
|
+
import type { NumberType } from '../number_plus/number.js';
|
|
2
|
+
import type { IndexAt } from './array_plus.js';
|
|
5
3
|
/**
|
|
6
4
|
* Gets the type of the array or tuple at index `N`.
|
|
7
5
|
*
|
|
@@ -12,15 +10,17 @@ import type { Negative } from '../number_plus/number.js';
|
|
|
12
10
|
* ```
|
|
13
11
|
* import type { At } from 'type-plus'
|
|
14
12
|
*
|
|
13
|
+
* type R = At<[1, 2, 3], 2> // 3
|
|
15
14
|
* type R = At<[1, 2, 3], -1> // 3
|
|
16
15
|
* ```
|
|
17
16
|
*/
|
|
18
|
-
export type At<A extends Array<unknown>, N extends number> = A
|
|
17
|
+
export type At<A extends Array<unknown>, N extends number, Fail = never> = IndexAt<A, N, Fail> extends infer I ? I extends number ? A[I] : Fail : never;
|
|
19
18
|
/**
|
|
20
19
|
* Concats two arrays.
|
|
21
20
|
*
|
|
22
21
|
* alias of: `[...A, ...B]`
|
|
23
22
|
*
|
|
23
|
+
* @alias ArrayPlus.Concat
|
|
24
24
|
* ```
|
|
25
25
|
* import type { Concat } form 'type-plus'
|
|
26
26
|
*
|
|
@@ -28,4 +28,15 @@ export type At<A extends Array<unknown>, N extends number> = A['length'] extends
|
|
|
28
28
|
* ```
|
|
29
29
|
*/
|
|
30
30
|
export type Concat<A extends unknown[], B extends unknown[]> = [...A, ...B];
|
|
31
|
+
/**
|
|
32
|
+
* Check if the type `A` is an array type and not a tuple.
|
|
33
|
+
*
|
|
34
|
+
* ```
|
|
35
|
+
* import type { ArrayType } from 'type-plus'
|
|
36
|
+
*
|
|
37
|
+
* type R = ArrayType<number[]> // true
|
|
38
|
+
* type R = ArrayType<[1]> // false
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
export type ArrayType<A extends unknown[], Then = A, Else = never> = NumberType<A['length'], Then, Else>;
|
|
31
42
|
//# sourceMappingURL=array.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"array.d.ts","sourceRoot":"","sources":["../../ts/array_plus/array.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"array.d.ts","sourceRoot":"","sources":["../../ts/array_plus/array.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAC1D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAA;AAE9C;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,EAAE,CAAC,CAAC,SAAS,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,SAAS,MAAM,EAAE,IAAI,GAAG,KAAK,IAAI,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,SAAS,MAAM,CAAC,GAC3G,CAAC,SAAS,MAAM,GACf,CAAC,CAAC,CAAC,CAAC,GACJ,IAAI,GACL,KAAK,CAAA;AAER;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,MAAM,CAAC,CAAC,SAAS,OAAO,EAAE,EAAE,CAAC,SAAS,OAAO,EAAE,IAAI,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC,CAAA;AAE3E;;;;;;;;;GASG;AACH,MAAM,MAAM,SAAS,CAAC,CAAC,SAAS,OAAO,EAAE,EAAE,IAAI,GAAG,CAAC,EAAE,IAAI,GAAG,KAAK,IAAI,UAAU,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { IsNever } from '../PrimitiveTypes.js';
|
|
2
|
+
import type { Abs } from '../math/Abs.js';
|
|
3
|
+
import type { GreaterThan } from '../math/GreaterThan.js';
|
|
4
|
+
import type { Subtract } from '../math/Subtract.js';
|
|
5
|
+
import type { Integer, Negative, NumberType } from '../number_plus/number.js';
|
|
6
|
+
import type { Equal } from '../predicates/Equal.js';
|
|
7
|
+
export type * from './array.js';
|
|
8
|
+
/**
|
|
9
|
+
* Gets the normalized index to access the element of an array or tuple.
|
|
10
|
+
*
|
|
11
|
+
* ```
|
|
12
|
+
* import type { ArrayPlus } from 'type-plus'
|
|
13
|
+
*
|
|
14
|
+
* type R = ArrayPlus.IndexAt<['a', 'b', 'c'], 2> // 2
|
|
15
|
+
* type R = ArrayPlus.IndexAt<['a', 'b', 'c'], -2> // 1
|
|
16
|
+
*
|
|
17
|
+
* type R = ArrayPlus.IndexAt<['a', 'b', 'c'], 3> // never
|
|
18
|
+
* type R = ArrayPlus.IndexAt<['a', 'b', 'c'], -4> // never
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export type IndexAt<A extends Array<unknown>, N extends number, Fail = never> = Equal<A['length'], 0, Fail, Integer<N, NumberType<A['length'], N, Negative<N, GreaterThan<Abs<N>, A['length']> extends true ? Fail : Subtract<A['length'], Abs<N>>, GreaterThan<A['length'], N> extends true ? N : Fail>>, NumberType<N, N, Fail>>>;
|
|
22
|
+
/**
|
|
23
|
+
* Is N an out of bound index of A.
|
|
24
|
+
*
|
|
25
|
+
* ```
|
|
26
|
+
* import { IsIndexOutOfBound } from 'type-plus'
|
|
27
|
+
*
|
|
28
|
+
* type R = IsIndexOutOfBound<[1], 0> // false
|
|
29
|
+
* type R = IsIndexOutOfBound<[1], -1> // false
|
|
30
|
+
|
|
31
|
+
* type R = IsIndexOutOfBound<[1], 1> // true
|
|
32
|
+
* type R = IsIndexOutOfBound<[1], -2> // true
|
|
33
|
+
*/
|
|
34
|
+
export type IsIndexOutOfBound<A extends unknown[], N extends number, Then = true, Else = false> = IsNever<IndexAt<A, N>, Then, Else>;
|
|
35
|
+
//# sourceMappingURL=array_plus.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"array_plus.d.ts","sourceRoot":"","sources":["../../ts/array_plus/array_plus.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AACnD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AACzD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AACnD,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAC7E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAA;AAEnD,mBAAmB,YAAY,CAAA;AAE/B;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,OAAO,CAAC,CAAC,SAAS,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,SAAS,MAAM,EAAE,IAAI,GAAG,KAAK,IAAI,KAAK,CACpF,CAAC,CAAC,QAAQ,CAAC,EACX,CAAC,EACD,IAAI,EACJ,OAAO,CACN,CAAC,EACD,UAAU,CACT,CAAC,CAAC,QAAQ,CAAC,EAEX,CAAC,EAED,QAAQ,CACP,CAAC,EACD,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,SAAS,IAAI,GAAG,IAAI,GAAG,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,EACpF,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,SAAS,IAAI,GAAG,CAAC,GAAG,IAAI,CACnD,CACD,EAED,UAAU,CACT,CAAC,EAED,CAAC,EACD,IAAI,CACJ,CACD,CACD,CAAA;AAED;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,iBAAiB,CAAC,CAAC,SAAS,OAAO,EAAE,EAAE,CAAC,SAAS,MAAM,EAAE,IAAI,GAAG,IAAI,EAAE,IAAI,GAAG,KAAK,IAAI,OAAO,CACxG,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,EACb,IAAI,EACJ,IAAI,CACJ,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"array_plus.js","sourceRoot":"","sources":["../../ts/array_plus/array_plus.ts"],"names":[],"mappings":""}
|
|
@@ -5,5 +5,5 @@ import type { DigitArray, IsPositive, IsWhole } from '../math/index.js';
|
|
|
5
5
|
* @see https://github.com/microsoft/TypeScript/issues/26223#issuecomment-674514787
|
|
6
6
|
* @see https://github.com/microsoft/TypeScript/issues/47874#issuecomment-1039157322
|
|
7
7
|
*/
|
|
8
|
-
export type CreateTuple<L extends number, T =
|
|
8
|
+
export type CreateTuple<L extends number, T = unknown, Fail = never> = number extends L ? T[] : IsPositive<L> extends true ? IsWhole<L> extends true ? DigitArray.ToTuple<[], DigitArray.FromNumber<L>, T> : Fail : Fail;
|
|
9
9
|
//# sourceMappingURL=create_tuple.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create_tuple.d.ts","sourceRoot":"","sources":["../../ts/array_plus/create_tuple.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAEvE;;;;;GAKG;AACH,MAAM,MAAM,WAAW,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,GAAG,
|
|
1
|
+
{"version":3,"file":"create_tuple.d.ts","sourceRoot":"","sources":["../../ts/array_plus/create_tuple.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAEvE;;;;;GAKG;AACH,MAAM,MAAM,WAAW,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,GAAG,OAAO,EAAE,IAAI,GAAG,KAAK,IAAI,MAAM,SAAS,CAAC,GACpF,CAAC,EAAE,GACH,UAAU,CAAC,CAAC,CAAC,SAAS,IAAI,GAC1B,OAAO,CAAC,CAAC,CAAC,SAAS,IAAI,GACtB,UAAU,CAAC,OAAO,CAAC,EAAE,EAAE,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,GACnD,IAAI,GACL,IAAI,CAAA"}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
export type * from './array.js';
|
|
2
|
-
export type
|
|
3
|
-
export type
|
|
2
|
+
export type * from './common_prop_keys.js';
|
|
3
|
+
export type * from './create_tuple.js';
|
|
4
4
|
export * from './drop.js';
|
|
5
|
-
export type
|
|
6
|
-
export type
|
|
7
|
-
export type
|
|
8
|
-
export type
|
|
9
|
-
export type
|
|
10
|
-
export type
|
|
11
|
-
export type
|
|
5
|
+
export type * from './filter.js';
|
|
6
|
+
export type * from './find_first.js';
|
|
7
|
+
export type * from './find_last.js';
|
|
8
|
+
export type * from './head.js';
|
|
9
|
+
export type * from './intersect_of_props.js';
|
|
10
|
+
export type * from './is_array.js';
|
|
11
|
+
export type * from './last.js';
|
|
12
12
|
export * from './literal_array.js';
|
|
13
|
-
export type
|
|
13
|
+
export type * from './pad_left.js';
|
|
14
14
|
export * from './reduce_while.js';
|
|
15
|
-
export type
|
|
16
|
-
export type
|
|
17
|
-
export type
|
|
18
|
-
export type
|
|
19
|
-
export type
|
|
15
|
+
export type * from './reverse.js';
|
|
16
|
+
export type * from './some.js';
|
|
17
|
+
export type * from './tail.js';
|
|
18
|
+
export type * from './union_of_props.js';
|
|
19
|
+
export type * from './union_of_values.js';
|
|
20
20
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../ts/array_plus/index.ts"],"names":[],"mappings":"AAAA,mBAAmB,YAAY,CAAA;AAC/B,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../ts/array_plus/index.ts"],"names":[],"mappings":"AAAA,mBAAmB,YAAY,CAAA;AAC/B,mBAAmB,uBAAuB,CAAA;AAC1C,mBAAmB,mBAAmB,CAAA;AACtC,cAAc,WAAW,CAAA;AACzB,mBAAmB,aAAa,CAAA;AAChC,mBAAmB,iBAAiB,CAAA;AACpC,mBAAmB,gBAAgB,CAAA;AACnC,mBAAmB,WAAW,CAAA;AAC9B,mBAAmB,yBAAyB,CAAA;AAC5C,mBAAmB,eAAe,CAAA;AAClC,mBAAmB,WAAW,CAAA;AAC9B,cAAc,oBAAoB,CAAA;AAClC,mBAAmB,eAAe,CAAA;AAClC,cAAc,mBAAmB,CAAA;AACjC,mBAAmB,cAAc,CAAA;AACjC,mBAAmB,WAAW,CAAA;AAC9B,mBAAmB,WAAW,CAAA;AAC9B,mBAAmB,qBAAqB,CAAA;AACxC,mBAAmB,sBAAsB,CAAA"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import type { IsAny } from '../any_plus/any.js';
|
|
2
|
+
import type { Equal } from '../predicates/index.js';
|
|
3
|
+
import type { CreateTuple } from './create_tuple.js';
|
|
4
|
+
import type { UnionOfValues } from './union_of_values.js';
|
|
4
5
|
export type PadLeft<A extends any[], Total extends number, PadWith = any> = number extends A['length'] ? IsAny<UnionOfValues<A>> extends true ? A : Equal<UnionOfValues<A>, PadWith> extends true ? A : PadLeft<[...CreateTuple<Total, PadWith>, ...A], Total, PadWith> : CreateTuple<Total, any> extends [...infer U, ...A] ? number extends U['length'] ? A : [...CreateTuple<U['length'], PadWith>, ...A] : A;
|
|
5
6
|
//# sourceMappingURL=pad_left.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pad_left.d.ts","sourceRoot":"","sources":["../../ts/array_plus/pad_left.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAA;
|
|
1
|
+
{"version":3,"file":"pad_left.d.ts","sourceRoot":"","sources":["../../ts/array_plus/pad_left.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAA;AAC/C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAA;AACnD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAEzD,MAAM,MAAM,OAAO,CAAC,CAAC,SAAS,GAAG,EAAE,EAAE,KAAK,SAAS,MAAM,EAAE,OAAO,GAAG,GAAG,IAAI,MAAM,SAAS,CAAC,CAAC,QAAQ,CAAC,GACnG,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,SAAS,IAAI,GACnC,CAAC,GACD,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,SAAS,IAAI,GAC7C,CAAC,GACD,OAAO,CAAC,CAAC,GAAG,WAAW,CAAC,KAAK,EAAE,OAAO,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,GAChE,WAAW,CAAC,KAAK,EAAE,GAAG,CAAC,SAAS,CAAC,GAAG,MAAM,CAAC,EAAE,GAAG,CAAC,CAAC,GAClD,MAAM,SAAS,CAAC,CAAC,QAAQ,CAAC,GACzB,CAAC,GACD,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC,EAAE,GAAG,CAAC,CAAC,GAC7C,CAAC,CAAA"}
|
package/cjs/array_plus/tail.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tail.d.ts","sourceRoot":"","sources":["../../ts/array_plus/tail.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;
|
|
1
|
+
{"version":3,"file":"tail.d.ts","sourceRoot":"","sources":["../../ts/array_plus/tail.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAEzD;;GAEG;AACH,MAAM,MAAM,IAAI,CAAC,CAAC,SAAS,GAAG,EAAE,IAAI,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,GACtD,KAAK,GACL,CAAC,SAAS,CAAC,GAAG,EAAE,GAAG,MAAM,IAAI,CAAC,GAC9B,IAAI,SAAS,aAAa,CAAC,CAAC,CAAC,EAAE,GAC9B,IAAI,GACJ,KAAK,GACN,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assertType.d.ts","sourceRoot":"","sources":["../../ts/assertion/assertType.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"assertType.d.ts","sourceRoot":"","sources":["../../ts/assertion/assertType.ts"],"names":[],"mappings":"AACA,OAAO,EAAiB,KAAK,cAAc,EAAE,MAAM,mBAAmB,CAAA;AACtE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAEvD;;;GAGG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,GAAG,OAAO,CAAC,OAAO,IAAI,CAAC,CAAA;AAC/D,wBAAgB,UAAU,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,CAAC,CAAA;AACnG,wBAAgB,UAAU,CAAC,CAAC,SAAS,KAAK,GAAG,IAAI,EAAE,GAAG,KAAK,GAAG,EAC7D,OAAO,EAAE,OAAO,EAChB,WAAW,EAAE,CAAC,GACZ,OAAO,CAAC,OAAO,IAAI,YAAY,CAAC,CAAC,CAAC,CAAA;yBAHrB,UAAU"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assertType.js","sourceRoot":"","sources":["../../ts/assertion/assertType.ts"],"names":[],"mappings":";;;AAAA,qCAAiC;AACjC,
|
|
1
|
+
{"version":3,"file":"assertType.js","sourceRoot":"","sources":["../../ts/assertion/assertType.ts"],"names":[],"mappings":"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"}
|
package/cjs/index.d.ts
CHANGED
|
@@ -3,7 +3,8 @@ export type { ComposableTypes, NonComposableTypes } from './ComposableTypes.js';
|
|
|
3
3
|
export type { JSONArray, JSONObject, JSONPrimitive, JSONTypes } from './JSONTypes.js';
|
|
4
4
|
export type { IsNever, PrimitiveTypes } from './PrimitiveTypes.js';
|
|
5
5
|
export type { UnionKeys } from './UnionKeys.js';
|
|
6
|
-
export *
|
|
6
|
+
export * from './any_plus/index.js';
|
|
7
|
+
export * as ArrayPlus from './array_plus/array_plus.js';
|
|
7
8
|
export * from './array_plus/index.js';
|
|
8
9
|
export * from './assertion/index.js';
|
|
9
10
|
export * from './class/index.js';
|
|
@@ -12,8 +13,8 @@ export * from './functional/index.js';
|
|
|
12
13
|
export type { Abs, Add, Decrement, Digit, DigitArray, GreaterThan, Increment, IsPositive, IsWhole, Max, Subtract } from './math/index.js';
|
|
13
14
|
export * from './nodejs/index.js';
|
|
14
15
|
export * from './nominal-types/index.js';
|
|
15
|
-
export * as NumberPlus from './number_plus/_plus.js';
|
|
16
16
|
export * from './number_plus/index.js';
|
|
17
|
+
export * as NumberPlus from './number_plus/number_plus.js';
|
|
17
18
|
export * from './object/index.js';
|
|
18
19
|
export * from './predicates/index.js';
|
|
19
20
|
export * from './promise/index.js';
|
package/cjs/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../ts/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AAC7D,YAAY,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AAC/E,YAAY,EAAE,SAAS,EAAE,UAAU,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AACrF,YAAY,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAGlE,YAAY,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC/C,OAAO,KAAK,SAAS,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../ts/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AAC7D,YAAY,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AAC/E,YAAY,EAAE,SAAS,EAAE,UAAU,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AACrF,YAAY,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAGlE,YAAY,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC/C,cAAc,qBAAqB,CAAA;AACnC,OAAO,KAAK,SAAS,MAAM,4BAA4B,CAAA;AACvD,cAAc,uBAAuB,CAAA;AACrC,cAAc,sBAAsB,CAAA;AACpC,cAAc,kBAAkB,CAAA;AAChC,cAAc,qBAAqB,CAAA;AACnC,cAAc,uBAAuB,CAAA;AACrC,YAAY,EACX,GAAG,EACH,GAAG,EACH,SAAS,EACT,KAAK,EACL,UAAU,EACV,WAAW,EACX,SAAS,EACT,UAAU,EACV,OAAO,EACP,GAAG,EACH,QAAQ,EACR,MAAM,iBAAiB,CAAA;AACxB,cAAc,mBAAmB,CAAA;AACjC,cAAc,0BAA0B,CAAA;AACxC,cAAc,wBAAwB,CAAA;AACtC,OAAO,KAAK,UAAU,MAAM,8BAA8B,CAAA;AAC1D,cAAc,mBAAmB,CAAA;AACjC,cAAc,uBAAuB,CAAA;AACrC,cAAc,oBAAoB,CAAA;AAClC,cAAc,oBAAoB,CAAA;AAClC,cAAc,kBAAkB,CAAA"}
|
package/cjs/index.js
CHANGED
|
@@ -15,6 +15,9 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
19
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
20
|
+
};
|
|
18
21
|
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
22
|
if (mod && mod.__esModule) return mod;
|
|
20
23
|
var result = {};
|
|
@@ -22,9 +25,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
22
25
|
__setModuleDefault(result, mod);
|
|
23
26
|
return result;
|
|
24
27
|
};
|
|
25
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
26
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
27
|
-
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
29
|
exports.NumberPlus = exports.ArrayPlus = exports.unpartial = exports.requiredDeep = exports.required = void 0;
|
|
30
30
|
// import * as types from './types/index.js'
|
|
@@ -32,7 +32,8 @@ var unpartial_1 = require("unpartial");
|
|
|
32
32
|
Object.defineProperty(exports, "required", { enumerable: true, get: function () { return unpartial_1.required; } });
|
|
33
33
|
Object.defineProperty(exports, "requiredDeep", { enumerable: true, get: function () { return unpartial_1.requiredDeep; } });
|
|
34
34
|
Object.defineProperty(exports, "unpartial", { enumerable: true, get: function () { return unpartial_1.unpartial; } });
|
|
35
|
-
|
|
35
|
+
__exportStar(require("./any_plus/index.js"), exports);
|
|
36
|
+
exports.ArrayPlus = __importStar(require("./array_plus/array_plus.js"));
|
|
36
37
|
__exportStar(require("./array_plus/index.js"), exports);
|
|
37
38
|
__exportStar(require("./assertion/index.js"), exports);
|
|
38
39
|
__exportStar(require("./class/index.js"), exports);
|
|
@@ -40,8 +41,8 @@ __exportStar(require("./function/index.js"), exports);
|
|
|
40
41
|
__exportStar(require("./functional/index.js"), exports);
|
|
41
42
|
__exportStar(require("./nodejs/index.js"), exports);
|
|
42
43
|
__exportStar(require("./nominal-types/index.js"), exports);
|
|
43
|
-
exports.NumberPlus = __importStar(require("./number_plus/_plus.js"));
|
|
44
44
|
__exportStar(require("./number_plus/index.js"), exports);
|
|
45
|
+
exports.NumberPlus = __importStar(require("./number_plus/number_plus.js"));
|
|
45
46
|
__exportStar(require("./object/index.js"), exports);
|
|
46
47
|
__exportStar(require("./predicates/index.js"), exports);
|
|
47
48
|
__exportStar(require("./promise/index.js"), exports);
|
package/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../ts/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4CAA4C;AAC5C,uCAA6D;AAApD,qGAAA,QAAQ,OAAA;AAAE,yGAAA,YAAY,OAAA;AAAE,sGAAA,SAAS,OAAA;AAO1C,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../ts/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4CAA4C;AAC5C,uCAA6D;AAApD,qGAAA,QAAQ,OAAA;AAAE,yGAAA,YAAY,OAAA;AAAE,sGAAA,SAAS,OAAA;AAO1C,sDAAmC;AACnC,wEAAuD;AACvD,wDAAqC;AACrC,uDAAoC;AACpC,mDAAgC;AAChC,sDAAmC;AACnC,wDAAqC;AAcrC,oDAAiC;AACjC,2DAAwC;AACxC,yDAAsC;AACtC,2EAA0D;AAC1D,oDAAiC;AACjC,wDAAqC;AACrC,qDAAkC;AAClC,qDAAkC;AAClC,mDAAgC;AAChC,+BAA+B"}
|
package/cjs/math/Max.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { Equal } from '../predicates/index.js';
|
|
2
|
-
import { GreaterThan } from './GreaterThan.js';
|
|
2
|
+
import type { GreaterThan } from './GreaterThan.js';
|
|
3
3
|
export type Max<A extends number, B extends number, Fail = never> = GreaterThan<A, B> extends infer Result ? Equal<Result, never> extends true ? Fail : Result extends true ? A : B : never;
|
|
4
4
|
//# sourceMappingURL=Max.d.ts.map
|
package/cjs/math/Max.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Max.d.ts","sourceRoot":"","sources":["../../ts/math/Max.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAA;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"Max.d.ts","sourceRoot":"","sources":["../../ts/math/Max.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAA;AACnD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAEnD,MAAM,MAAM,GAAG,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,MAAM,EAAE,IAAI,GAAG,KAAK,IAAI,WAAW,CAAC,CAAC,EAAE,CAAC,CAAC,SAAS,MAAM,MAAM,GACvG,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,SAAS,IAAI,GAChC,IAAI,GACJ,MAAM,SAAS,IAAI,GACnB,CAAC,GACD,CAAC,GACF,KAAK,CAAA"}
|
|
@@ -14,9 +14,11 @@ export type Zero = 0 | 0n;
|
|
|
14
14
|
*
|
|
15
15
|
* type R = Integer<0> // 0
|
|
16
16
|
* type R = Integer<1.1> // never
|
|
17
|
+
* type R = Integer<number> // never as it contains non-integer
|
|
17
18
|
*
|
|
18
19
|
* type R = Integer<0, true, false> // true
|
|
19
20
|
* type R = Integer<1.1, true, false> // false
|
|
21
|
+
*
|
|
20
22
|
* ```
|
|
21
23
|
*/
|
|
22
24
|
export type Integer<N extends Numeric, Then = N, Else = never> = `${N}` extends `${bigint}` ? Then : Else;
|
|
@@ -48,4 +50,15 @@ export type Negative<N extends Numeric, Then = N, Else = never> = N extends Zero
|
|
|
48
50
|
* ```
|
|
49
51
|
*/
|
|
50
52
|
export type NonNegative<N extends Numeric, Then = N, Else = never> = Negative<N, Else, Then>;
|
|
53
|
+
/**
|
|
54
|
+
* Check if the type `T` is exactly the type `number` and not numeric literals.
|
|
55
|
+
*
|
|
56
|
+
* ```
|
|
57
|
+
* import type { NumberType } from 'type-plus'
|
|
58
|
+
*
|
|
59
|
+
* type R = NumberType<number> // true
|
|
60
|
+
* type R = NumberType<1> // false
|
|
61
|
+
* ```
|
|
62
|
+
*/
|
|
63
|
+
export type NumberType<T extends number, Then = T, Else = never> = number extends T ? Then : Else;
|
|
51
64
|
//# sourceMappingURL=number.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"number.d.ts","sourceRoot":"","sources":["../../ts/number_plus/number.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,OAAO,GAAG,MAAM,GAAG,MAAM,CAAA;AAErC;;GAEG;AACH,MAAM,MAAM,IAAI,GAAG,CAAC,GAAG,EAAE,CAAA;AAEzB
|
|
1
|
+
{"version":3,"file":"number.d.ts","sourceRoot":"","sources":["../../ts/number_plus/number.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,OAAO,GAAG,MAAM,GAAG,MAAM,CAAA;AAErC;;GAEG;AACH,MAAM,MAAM,IAAI,GAAG,CAAC,GAAG,EAAE,CAAA;AAEzB;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,OAAO,CAAC,CAAC,SAAS,OAAO,EAAE,IAAI,GAAG,CAAC,EAAE,IAAI,GAAG,KAAK,IAAI,GAAG,CAAC,EAAE,SAAS,GAAG,MAAM,EAAE,GAAG,IAAI,GAAG,IAAI,CAAA;AAEzG;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,QAAQ,CAAC,CAAC,SAAS,OAAO,EAAE,IAAI,GAAG,CAAC,EAAE,IAAI,GAAG,KAAK,IAAI,CAAC,SAAS,IAAI,GAC7E,IAAI,GACJ,GAAG,CAAC,EAAE,SAAS,IAAI,MAAM,EAAE,GAC3B,IAAI,GACJ,IAAI,CAAA;AAEP;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,WAAW,CAAC,CAAC,SAAS,OAAO,EAAE,IAAI,GAAG,CAAC,EAAE,IAAI,GAAG,KAAK,IAAI,QAAQ,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA;AAE5F;;;;;;;;;GASG;AACH,MAAM,MAAM,UAAU,CAAC,CAAC,SAAS,MAAM,EAAE,IAAI,GAAG,CAAC,EAAE,IAAI,GAAG,KAAK,IAAI,MAAM,SAAS,CAAC,GAAG,IAAI,GAAG,IAAI,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"number_plus.d.ts","sourceRoot":"","sources":["../../ts/number_plus/number_plus.ts"],"names":[],"mappings":"AAAA,mBAAmB,aAAa,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"number_plus.js","sourceRoot":"","sources":["../../ts/number_plus/number_plus.ts"],"names":[],"mappings":""}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { And, Not } from '../predicates/index.js';
|
|
1
|
+
import type { And, Not } from '../predicates/index.js';
|
|
2
2
|
import type { AnyRecord } from './AnyRecord.js';
|
|
3
|
-
import { HasKey } from './hasKey.js';
|
|
3
|
+
import type { HasKey } from './hasKey.js';
|
|
4
4
|
/**
|
|
5
5
|
* Are the two records disjoint from each other.
|
|
6
6
|
* Disjoint means no common property.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IsDisjoint.d.ts","sourceRoot":"","sources":["../../ts/object/IsDisjoint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,wBAAwB,CAAA;
|
|
1
|
+
{"version":3,"file":"IsDisjoint.d.ts","sourceRoot":"","sources":["../../ts/object/IsDisjoint.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,wBAAwB,CAAA;AACtD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC/C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAEzC;;;GAGG;AACH,MAAM,MAAM,UAAU,CAAC,CAAC,SAAS,SAAS,EAAE,CAAC,SAAS,SAAS,IAAI,GAAG,CACrE,GAAG,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,EACvB,GAAG,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CACvB,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ValueOf } from './ValueOf.js';
|
|
1
|
+
import type { ValueOf } from './ValueOf.js';
|
|
2
2
|
import type { IsDisjoint } from './IsDisjoint.js';
|
|
3
3
|
import type { AnyRecord } from './AnyRecord.js';
|
|
4
4
|
export type KeysWithDiffType<A extends AnyRecord, B extends AnyRecord> = IsDisjoint<A, B> extends true ? never : ValueOf<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KeysWithDiffType.d.ts","sourceRoot":"","sources":["../../ts/object/KeysWithDiffType.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;
|
|
1
|
+
{"version":3,"file":"KeysWithDiffType.d.ts","sourceRoot":"","sources":["../../ts/object/KeysWithDiffType.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAC3C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE/C,MAAM,MAAM,gBAAgB,CAAC,CAAC,SAAS,SAAS,EAAE,CAAC,SAAS,SAAS,IAAI,UAAU,CAAC,CAAC,EAAE,CAAC,CAAC,SAAS,IAAI,GACnG,KAAK,GACL,OAAO,CAAC;KACP,CAAC,IAAI,MAAM,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,GAAG,CAAC;CACtD,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KnownKeys.d.ts","sourceRoot":"","sources":["../../ts/object/KnownKeys.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;
|
|
1
|
+
{"version":3,"file":"KnownKeys.d.ts","sourceRoot":"","sources":["../../ts/object/KnownKeys.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAG1D,MAAM,MAAM,SAAS,CAAC,CAAC,IAAI,CAAC,SAAS,cAAc,GAChD,KAAK,GACL;KACC,CAAC,IAAI,MAAM,CAAC,GAAG,MAAM,SAAS,CAAC,GAAG,KAAK,GAAG,MAAM,SAAS,CAAC,GAAG,KAAK,GAAG,CAAC;CACtE,SAAS;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,MAAM,CAAC;CAAE,GAErC,EAAE,SAAS,CAAC,GACX,KAAK,GACL,CAAC,GACF,KAAK,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { KeyTypes } from './KeyTypes.js';
|
|
1
|
+
import type { KeyTypes } from './KeyTypes.js';
|
|
2
2
|
export type OptionalKeys<O extends Record<KeyTypes, any>> = O extends unknown ? OptionalKeys._<O> : never;
|
|
3
3
|
export declare namespace OptionalKeys {
|
|
4
4
|
type _<O extends Record<KeyTypes, any>> = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OptionalKeys.d.ts","sourceRoot":"","sources":["../../ts/object/OptionalKeys.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"OptionalKeys.d.ts","sourceRoot":"","sources":["../../ts/object/OptionalKeys.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAE7C,MAAM,MAAM,YAAY,CAAC,CAAC,SAAS,MAAM,CAAC,QAAQ,EAAE,GAAG,CAAC,IAAI,CAAC,SAAS,OAAO,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,CAAA;AAEzG,yBAAiB,YAAY,CAAC;IAC7B,KAAY,CAAC,CAAC,CAAC,SAAS,MAAM,CAAC,QAAQ,EAAE,GAAG,CAAC,IAAI;SAC/C,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,QAAQ,EAAE,GAAG,CAAC,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK;KACtE,CAAC,MAAM,CAAC,CAAC,CAAA;CACV"}
|
package/cjs/object/Partial.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { UnionKeys } from '../UnionKeys.js';
|
|
2
|
-
import { Omit } from './omit.js';
|
|
3
|
-
import { Pick } from './pick.js';
|
|
1
|
+
import type { UnionKeys } from '../UnionKeys.js';
|
|
2
|
+
import type { Omit } from './omit.js';
|
|
3
|
+
import type { Pick } from './pick.js';
|
|
4
4
|
/**
|
|
5
5
|
* Apply `Partial<>` on the selected properties.
|
|
6
6
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Partial.d.ts","sourceRoot":"","sources":["../../ts/object/Partial.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"Partial.d.ts","sourceRoot":"","sources":["../../ts/object/Partial.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAChD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AACrC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAErC;;GAEG;AACH,MAAM,MAAM,WAAW,CAAC,CAAC,EAAE,CAAC,SAAS,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,KAAK,CAAA;AAE3G;;GAEG;AACH,MAAM,MAAM,aAAa,CAAC,CAAC,EAAE,CAAC,SAAS,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,KAAK,CAAA;AAE7G;;GAEG;AACH,MAAM,MAAM,WAAW,CAAC,CAAC,EAAE,CAAC,SAAS,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,KAAK,CAAA"}
|