@eslinted/core 3.1.11 → 3.1.13-rc.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (117) hide show
  1. package/.github/workflows/PROD.main.yml +37 -0
  2. package/.github/workflows/dev.yml +37 -0
  3. package/LICENSE +21 -21
  4. package/README.md +3 -3
  5. package/SECURITY.md +9 -9
  6. package/eslint.config.js +3 -3
  7. package/package.json +54 -54
  8. package/src/boundary/index.ts +6 -6
  9. package/src/boundary/input/files/base/index.ts +5 -5
  10. package/src/boundary/input/files/includes/index.ts +5 -5
  11. package/src/boundary/input/files/index.ts +11 -11
  12. package/src/boundary/input/index.ts +23 -23
  13. package/src/boundary/input/parsers/index.ts +5 -5
  14. package/src/boundary/input/plugins/index.ts +5 -5
  15. package/src/boundary/input/rules/index.ts +11 -11
  16. package/src/boundary/input/rules/overrides/index.ts +6 -6
  17. package/src/boundary/input/rules/preset/entry/index.ts +5 -5
  18. package/src/boundary/input/rules/preset/entry/object/index.ts +9 -9
  19. package/src/boundary/input/rules/preset/entry/object/state/index.ts +6 -6
  20. package/src/boundary/input/rules/preset/index.ts +6 -6
  21. package/src/boundary/output/config/index.ts +25 -25
  22. package/src/boundary/output/config/option/index.ts +24 -24
  23. package/src/boundary/output/config/option/language/ecma/index.ts +3 -3
  24. package/src/boundary/output/config/option/language/index.ts +23 -23
  25. package/src/boundary/output/config/option/language/source/index.ts +3 -3
  26. package/src/boundary/output/config/option/linter/index.ts +4 -4
  27. package/src/boundary/output/config/option/plugins/index.ts +3 -3
  28. package/src/boundary/output/index.ts +3 -3
  29. package/src/dependency/globals/index.ts +8 -8
  30. package/src/dependency/index.ts +5 -5
  31. package/src/dependency/parsers/index.ts +13 -13
  32. package/src/dependency/plugins/index.ts +12 -12
  33. package/src/factory/files/index.ts +15 -15
  34. package/src/factory/index.ts +8 -8
  35. package/src/factory/options/index.ts +21 -21
  36. package/src/factory/options/option/html/index.ts +18 -18
  37. package/src/factory/options/option/index.ts +93 -93
  38. package/src/factory/options/option/js/index.ts +13 -13
  39. package/src/factory/options/option/json/index.ts +18 -18
  40. package/src/factory/options/option/jsonc/index.ts +18 -18
  41. package/src/factory/options/option/md/index.ts +18 -18
  42. package/src/factory/options/option/mocha/index.ts +28 -28
  43. package/src/factory/options/option/svelte/index.ts +32 -32
  44. package/src/factory/options/option/ts/index.ts +24 -24
  45. package/src/factory/options/option/yml/index.ts +18 -18
  46. package/src/factory/rulesets/index.ts +16 -16
  47. package/src/factory/rulesets/ruleset/index.ts +40 -40
  48. package/src/factory/rulesets/ruleset/rule/index.ts +8 -8
  49. package/src/index.ts +95 -95
  50. package/src/scopes/index.ts +14 -14
  51. package/tsconfig.json +161 -161
  52. package/types/typioca/literal/number/base32.d.ts +19 -19
  53. package/types/typioca/literal/number/base64.d.ts +35 -35
  54. package/types/typioca/literal/number/binary.d.ts +4 -4
  55. package/types/typioca/literal/number/decimal.d.ts +5 -5
  56. package/types/typioca/literal/number/hex.d.ts +10 -10
  57. package/types/typioca/literal/number/octal.d.ts +7 -7
  58. package/types/typioca/literal/number/quatral.d.ts +4 -4
  59. package/types/typioca/literal/number/ternary.d.ts +4 -4
  60. package/types/typioca/literal/string/base64char.d.ts +13 -13
  61. package/types/typioca/literal/string/digit.d.ts +12 -12
  62. package/types/typioca/literal/string/hexchar.d.ts +9 -9
  63. package/types/typioca/literal/string/letter.d.ts +35 -35
  64. package/types/typioca/safe/Safe.d.ts +2 -2
  65. package/types/typioca/safe/numbers/finite/Finite.d.ts +2 -2
  66. package/types/typioca/safe/numbers/finite.d.ts +1 -1
  67. package/types/typioca/safe/numbers/fint.d.ts +1 -1
  68. package/types/typioca/safe/numbers/int/Int.d.ts +2 -2
  69. package/types/typioca/safe/numbers/int.d.ts +1 -1
  70. package/types/typioca/safe/numbers/numberful.d.ts +1 -1
  71. package/types/typioca/safe/numbers/polarity/Negative.d.ts +4 -4
  72. package/types/typioca/safe/numbers/polarity/Positive.d.ts +4 -4
  73. package/types/typioca/safe/numbers/polarity/pole/Pole.d.ts +18 -18
  74. package/types/typioca/safe/primitive.d.ts +5 -5
  75. package/types/typioca/safe/strings/char.d.ts +1 -1
  76. package/types/typioca/safe/strings/length/PropLength.d.ts +3 -3
  77. package/types/typioca/safe/strings/stringful.d.ts +1 -1
  78. package/types/typioca/utility/interface/construct/Particord.d.ts +1 -1
  79. package/types/typioca/utility/interface/construct/Property.d.ts +8 -8
  80. package/types/typioca/utility/interface/construct/Recordful.d.ts +5 -5
  81. package/types/typioca/utility/interface/construct/Table.d.ts +3 -3
  82. package/types/typioca/utility/interface/construct/properties/Field.d.ts +1 -1
  83. package/types/typioca/utility/interface/construct/properties/Flag.d.ts +1 -1
  84. package/types/typioca/utility/interface/construct/properties/Limit.d.ts +8 -8
  85. package/types/typioca/utility/interface/construct/properties/List.d.ts +1 -1
  86. package/types/typioca/utility/interface/construct/properties/Listish.d.ts +1 -1
  87. package/types/typioca/utility/interface/construct/properties/Scalar.d.ts +1 -1
  88. package/types/typioca/utility/interface/construct/tables/FieldTable.d.ts +1 -1
  89. package/types/typioca/utility/interface/construct/tables/FlagTable.d.ts +1 -1
  90. package/types/typioca/utility/interface/construct/tables/ListTable.d.ts +1 -1
  91. package/types/typioca/utility/interface/construct/tables/ListishTable.d.ts +1 -1
  92. package/types/typioca/utility/interface/construct/tables/ScalarTable.d.ts +1 -1
  93. package/types/typioca/utility/interface/identity/Interface.d.ts +80 -80
  94. package/types/typioca/utility/interface/identity/Keys.d.ts +71 -71
  95. package/types/typioca/utility/interface/transform/Unrequire.d.ts +45 -45
  96. package/types/typioca/utility/iterable/construct/ArrayN.d.ts +12 -12
  97. package/types/typioca/utility/iterable/construct/Tuple.d.ts +27 -27
  98. package/types/typioca/utility/iterable/construct/arrays/Arrays.d.ts +1 -1
  99. package/types/typioca/utility/iterable/construct/tuples/Tuples.d.ts +9 -9
  100. package/types/typioca/utility/iterable/identity/DyadType.d.ts +3 -3
  101. package/types/typioca/utility/iterable/identity/MonadType.d.ts +48 -48
  102. package/types/typioca/utility/iterable/identity/TriadType.d.ts +3 -3
  103. package/types/typioca/utility/iterable/identity/array/ArrayType.d.ts +65 -65
  104. package/types/typioca/utility/iterable/identity/array/length/ArrayLength.d.ts +16 -16
  105. package/types/typioca/utility/iterable/transform/Join.d.ts +19 -19
  106. package/types/typioca/utility/iterable/transform/Unflat.d.ts +3 -3
  107. package/types/typioca/utility/iterable/transform/stringarray/Chain.d.ts +30 -30
  108. package/types/typioca/utility/iterable/transform/stringarray/PathN.d.ts +3 -3
  109. package/types/typioca/utility/iterable/transform/stringarray/stringify/Stringify.d.ts +5 -5
  110. package/types/typioca/utility/length/Length.d.ts +35 -35
  111. package/types/typioca/utility/null/null.d.ts +1 -1
  112. package/types/typioca/utility/null/nullable.d.ts +1 -1
  113. package/types/typioca/utility/primitive/Primeval.d.ts +42 -42
  114. package/types/typioca/utility/primitive/boolean/True.d.ts +30 -30
  115. package/types/typioca/utility/primitive/number/Numbered.d.ts +35 -35
  116. package/types/typioca/utility/primitive/string/literal.d.ts +22 -22
  117. package/types/typioca/utility/primitive/string/literalful.d.ts +28 -28
@@ -1,27 +1,27 @@
1
- // TODO: constrain to positive integer
2
- declare type Tuple<I, N extends number = 2> = [I] extends [never]
3
- ? never
4
- : N extends number
5
- ? N extends 0
6
- ? readonly []
7
- : TupleBuilder<I, Numbered<N>>
8
- : never;
9
-
10
- type TupleBuilder<I, N, H extends readonly I[] = readonly []> = H["length"] extends N
11
- ? H
12
- : TupleBuilder<I, N, readonly [...H, I]>;
13
-
14
- declare namespace Tuple {
15
- export type T = Tuple<string>;
16
- export type T0 = Tuple<string, 0>;
17
- export type T0a = Tuple<string, 1>;
18
- export type T0b = Tuple<string, 3>;
19
- export type T1 = Tuple<string | number>;
20
- export type T2 = Tuple<string, 2 | 3>;
21
- export type T3 = Tuple<string | number, 2 | 3>;
22
- export type T4 = Tuple<string, never>;
23
- export type T4a = Tuple<string, 0>;
24
- export type T4b = Tuple<string, 0 | 1>;
25
- }
26
-
27
- type NN = Numbered<5 | 10>;
1
+ // TODO: constrain to positive integer
2
+ declare type Tuple<I, N extends number = 2> = [I] extends [never]
3
+ ? never
4
+ : N extends number
5
+ ? N extends 0
6
+ ? readonly []
7
+ : TupleBuilder<I, Numbered<N>>
8
+ : never;
9
+
10
+ type TupleBuilder<I, N, H extends readonly I[] = readonly []> = H["length"] extends N
11
+ ? H
12
+ : TupleBuilder<I, N, readonly [...H, I]>;
13
+
14
+ declare namespace Tuple {
15
+ export type T = Tuple<string>;
16
+ export type T0 = Tuple<string, 0>;
17
+ export type T0a = Tuple<string, 1>;
18
+ export type T0b = Tuple<string, 3>;
19
+ export type T1 = Tuple<string | number>;
20
+ export type T2 = Tuple<string, 2 | 3>;
21
+ export type T3 = Tuple<string | number, 2 | 3>;
22
+ export type T4 = Tuple<string, never>;
23
+ export type T4a = Tuple<string, 0>;
24
+ export type T4b = Tuple<string, 0 | 1>;
25
+ }
26
+
27
+ type NN = Numbered<5 | 10>;
@@ -1 +1 @@
1
- declare type Arrayful<I> = ArrayN<I, 1>;
1
+ declare type Arrayful<I> = ArrayN<I, 1>;
@@ -1,9 +1,9 @@
1
- declare type Monad<I> = Tuple<I, 1>;
2
- declare type Triad<I> = Tuple<I, 3>;
3
- declare type Quad<I> = Tuple<I, 4>;
4
- declare type Pentad<I> = Tuple<I, 5>;
5
- declare type Hexad<I> = Tuple<I, 6>;
6
- declare type Heptad<I> = Tuple<I, 7>;
7
- declare type Octad<I> = Tuple<I, 8>;
8
- declare type Nonad<I> = Tuple<I, 9>;
9
- declare type Decad<I> = Tuple<I, 10>;
1
+ declare type Monad<I> = Tuple<I, 1>;
2
+ declare type Triad<I> = Tuple<I, 3>;
3
+ declare type Quad<I> = Tuple<I, 4>;
4
+ declare type Pentad<I> = Tuple<I, 5>;
5
+ declare type Hexad<I> = Tuple<I, 6>;
6
+ declare type Heptad<I> = Tuple<I, 7>;
7
+ declare type Octad<I> = Tuple<I, 8>;
8
+ declare type Nonad<I> = Tuple<I, 9>;
9
+ declare type Decad<I> = Tuple<I, 10>;
@@ -1,3 +1,3 @@
1
- declare type DyadType<A extends readonly unknown[]> = 1 extends ArrayLength<A>
2
- ? never
3
- : MonadType<A>;
1
+ declare type DyadType<A extends readonly unknown[]> = 1 extends ArrayLength<A>
2
+ ? never
3
+ : MonadType<A>;
@@ -1,48 +1,48 @@
1
- declare type MonadType<A extends readonly unknown[]> = 0 extends ArrayLength<A>
2
- ? never
3
- : ArrayType<A>;
4
-
5
- declare namespace MonadType {
6
- export type T0 = MonadType<[1, 1]>;
7
- export type T1 = MonadType<readonly [1, 1]>;
8
- export type T2 = MonadType<readonly [1, 1?]>;
9
- export type T3 = MonadType<readonly [1?, 1?]>;
10
- export type T4 = MonadType<readonly [1?, 1?]>;
11
- export type T5 = MonadType<[[]]>;
12
- export type T6 = MonadType<string[] | int[]>;
13
- export type T7 = MonadType<(string | int)[]>;
14
- export type T18 = MonadType<[string] | [5, 10]>;
15
- export type T8a = MonadType<Tuple<boolean>>;
16
- export type T8b = MonadType<ArrayN<string, 3>>;
17
- export type T8c = MonadType<
18
- | ArrayN<string, 3>
19
- | Tuple<boolean>
20
- | [string]
21
- | [5, 10]
22
- | [5, 13]
23
- | readonly [5, 10]
24
- >;
25
- }
26
-
27
- declare namespace NotMonadType {
28
- export type N12 = MonadType<never>;
29
- export type N26 = MonadType<[]>;
30
- export type N27 = MonadType<string[]>;
31
- export type N28 = MonadType<readonly []>;
32
- export type N29 = MonadType<readonly string[]>;
33
- export type N30 = MonadType<[5] | []>;
34
- export type N30a = MonadType<[5] | string[]>;
35
- export type N30b = MonadType<[5] | readonly []>;
36
- export type N30c = MonadType<[5] | readonly string[]>;
37
- export type N30d = MonadType<
38
- | []
39
- | [5, 10]
40
- | string []
41
- | readonly []
42
- | readonly [5, 10]
43
- | readonly string[]
44
- >;
45
- export type N31 = MonadType<ArrayN<string>>;
46
- export type N32 = MonadType<[string?]>;
47
- export type N33 = MonadType<readonly [string?]>;
48
- }
1
+ declare type MonadType<A extends readonly unknown[]> = 0 extends ArrayLength<A>
2
+ ? never
3
+ : ArrayType<A>;
4
+
5
+ declare namespace MonadType {
6
+ export type T0 = MonadType<[1, 1]>;
7
+ export type T1 = MonadType<readonly [1, 1]>;
8
+ export type T2 = MonadType<readonly [1, 1?]>;
9
+ export type T3 = MonadType<readonly [1?, 1?]>;
10
+ export type T4 = MonadType<readonly [1?, 1?]>;
11
+ export type T5 = MonadType<[[]]>;
12
+ export type T6 = MonadType<string[] | int[]>;
13
+ export type T7 = MonadType<(string | int)[]>;
14
+ export type T18 = MonadType<[string] | [5, 10]>;
15
+ export type T8a = MonadType<Tuple<boolean>>;
16
+ export type T8b = MonadType<ArrayN<string, 3>>;
17
+ export type T8c = MonadType<
18
+ | ArrayN<string, 3>
19
+ | Tuple<boolean>
20
+ | [string]
21
+ | [5, 10]
22
+ | [5, 13]
23
+ | readonly [5, 10]
24
+ >;
25
+ }
26
+
27
+ declare namespace NotMonadType {
28
+ export type N12 = MonadType<never>;
29
+ export type N26 = MonadType<[]>;
30
+ export type N27 = MonadType<string[]>;
31
+ export type N28 = MonadType<readonly []>;
32
+ export type N29 = MonadType<readonly string[]>;
33
+ export type N30 = MonadType<[5] | []>;
34
+ export type N30a = MonadType<[5] | string[]>;
35
+ export type N30b = MonadType<[5] | readonly []>;
36
+ export type N30c = MonadType<[5] | readonly string[]>;
37
+ export type N30d = MonadType<
38
+ | []
39
+ | [5, 10]
40
+ | string []
41
+ | readonly []
42
+ | readonly [5, 10]
43
+ | readonly string[]
44
+ >;
45
+ export type N31 = MonadType<ArrayN<string>>;
46
+ export type N32 = MonadType<[string?]>;
47
+ export type N33 = MonadType<readonly [string?]>;
48
+ }
@@ -1,3 +1,3 @@
1
- declare type TriadType<A extends readonly unknown[]> = 2 extends ArrayLength<A>
2
- ? never
3
- : DyadType<A>;
1
+ declare type TriadType<A extends readonly unknown[]> = 2 extends ArrayLength<A>
2
+ ? never
3
+ : DyadType<A>;
@@ -1,65 +1,65 @@
1
- declare type ArrayType<A> = [A] extends [readonly unknown[]] ? A : never;
2
-
3
- // tests
4
- declare namespace ArrayType {
5
- export type T0 = ArrayType<[]>;
6
- export type T1 = ArrayType<[1, 1]>;
7
- export type T2 = ArrayType<string[]>;
8
- export type T3 = ArrayType<readonly []>;
9
- export type T4 = ArrayType<readonly [1, 1]>;
10
- export type T5 = ArrayType<readonly string[]>;
11
- export type T6 = ArrayType<[[]]>;
12
- export type T7 = ArrayType<string[] | int[]>;
13
- export type T8 = ArrayType<(string | int)[]>;
14
- export type T9 = ArrayType<
15
- | []
16
- | [5, 10]
17
- | string []
18
- | readonly []
19
- | readonly [5, 10]
20
- | readonly string[]
21
- >;
22
- export type T10 = ArrayType<[1?, ...string[]]>;
23
- export type T11 = ArrayType<[1] | [1, 2?]>;
24
- }
25
-
26
- declare namespace NotArrayType {
27
- export type N0 = ArrayType<"">;
28
- export type N1 = ArrayType<"test">;
29
- export type N2 = ArrayType<string>;
30
- export type N3 = ArrayType<boolean>;
31
- export type N4 = ArrayType<true>;
32
- export type N5 = ArrayType<false>;
33
- export type N6 = ArrayType<0>;
34
- export type N7 = ArrayType<1>;
35
- export type N8 = ArrayType<number>;
36
- export type N9 = ArrayType<null>;
37
- export type N10 = ArrayType<undefined>;
38
- export type N11 = ArrayType<unknown>;
39
- export type N12 = ArrayType<never>;
40
- export type N13 = ArrayType<void>;
41
- export type N14 = ArrayType<()=> void>;
42
- export type N15 = ArrayType<(a: string)=> []>;
43
- export type N16 = ArrayType<Record<string, unknown>>;
44
- export type N17 = ArrayType<Record<number, 5>>;
45
- export type N18 = ArrayType<stringful>;
46
- export type N19 = ArrayType<{ 0: string }>;
47
- export type N20 = ArrayType<{
48
- 0: string;
49
- length: 1;
50
- }>;
51
- export type N21 = ArrayType<symbol>;
52
- export type N22 = ArrayType<object>;
53
- export type N23 = ArrayType<
54
- | []
55
- | object
56
- >;
57
- export type N24 = ArrayType<
58
- | []
59
- | string
60
- >;
61
- export type N25 = ArrayType<
62
- | []
63
- | null
64
- >;
65
- }
1
+ declare type ArrayType<A> = [A] extends [readonly unknown[]] ? A : never;
2
+
3
+ // tests
4
+ declare namespace ArrayType {
5
+ export type T0 = ArrayType<[]>;
6
+ export type T1 = ArrayType<[1, 1]>;
7
+ export type T2 = ArrayType<string[]>;
8
+ export type T3 = ArrayType<readonly []>;
9
+ export type T4 = ArrayType<readonly [1, 1]>;
10
+ export type T5 = ArrayType<readonly string[]>;
11
+ export type T6 = ArrayType<[[]]>;
12
+ export type T7 = ArrayType<string[] | int[]>;
13
+ export type T8 = ArrayType<(string | int)[]>;
14
+ export type T9 = ArrayType<
15
+ | []
16
+ | [5, 10]
17
+ | string []
18
+ | readonly []
19
+ | readonly [5, 10]
20
+ | readonly string[]
21
+ >;
22
+ export type T10 = ArrayType<[1?, ...string[]]>;
23
+ export type T11 = ArrayType<[1] | [1, 2?]>;
24
+ }
25
+
26
+ declare namespace NotArrayType {
27
+ export type N0 = ArrayType<"">;
28
+ export type N1 = ArrayType<"test">;
29
+ export type N2 = ArrayType<string>;
30
+ export type N3 = ArrayType<boolean>;
31
+ export type N4 = ArrayType<true>;
32
+ export type N5 = ArrayType<false>;
33
+ export type N6 = ArrayType<0>;
34
+ export type N7 = ArrayType<1>;
35
+ export type N8 = ArrayType<number>;
36
+ export type N9 = ArrayType<null>;
37
+ export type N10 = ArrayType<undefined>;
38
+ export type N11 = ArrayType<unknown>;
39
+ export type N12 = ArrayType<never>;
40
+ export type N13 = ArrayType<void>;
41
+ export type N14 = ArrayType<()=> void>;
42
+ export type N15 = ArrayType<(a: string)=> []>;
43
+ export type N16 = ArrayType<Record<string, unknown>>;
44
+ export type N17 = ArrayType<Record<number, 5>>;
45
+ export type N18 = ArrayType<stringful>;
46
+ export type N19 = ArrayType<{ 0: string }>;
47
+ export type N20 = ArrayType<{
48
+ 0: string;
49
+ length: 1;
50
+ }>;
51
+ export type N21 = ArrayType<symbol>;
52
+ export type N22 = ArrayType<object>;
53
+ export type N23 = ArrayType<
54
+ | []
55
+ | object
56
+ >;
57
+ export type N24 = ArrayType<
58
+ | []
59
+ | string
60
+ >;
61
+ export type N25 = ArrayType<
62
+ | []
63
+ | null
64
+ >;
65
+ }
@@ -1,16 +1,16 @@
1
- declare type ArrayLength<A extends readonly unknown[]> = Length<ArrayType<A>["length"]>;
2
-
3
- declare namespace ArrayLength {
4
- export type T0 = ArrayLength<[]>;
5
- export type T0a = ArrayLength<string[]>;
6
- export type T0b = ArrayLength<readonly []>;
7
- export type T0d = ArrayLength<readonly string[]>;
8
- export type T0c = ArrayLength<[string?, string?]>;
9
- export type T1 = ArrayLength<[string] | [string, string?, string?]>;
10
- export type T1b = ArrayLength<[string] | [string?, string?, string?]>; // 0 | 1 | 2 | 3 -- empty Tuple -> length: 0 is just 0, so does not consume other possible lengths
11
- export type T1c = ArrayLength<string[] | [string, string, string]>; // 0 -- Array -> length: number coerced to length 0 but consumes all other possible lengths
12
- }
13
-
14
- declare namespace NotArrayLength {
15
- export type N = ArrayLength<never>;
16
- }
1
+ declare type ArrayLength<A extends readonly unknown[]> = Length<ArrayType<A>["length"]>;
2
+
3
+ declare namespace ArrayLength {
4
+ export type T0 = ArrayLength<[]>;
5
+ export type T0a = ArrayLength<string[]>;
6
+ export type T0b = ArrayLength<readonly []>;
7
+ export type T0d = ArrayLength<readonly string[]>;
8
+ export type T0c = ArrayLength<[string?, string?]>;
9
+ export type T1 = ArrayLength<[string] | [string, string?, string?]>;
10
+ export type T1b = ArrayLength<[string] | [string?, string?, string?]>; // 0 | 1 | 2 | 3 -- empty Tuple -> length: 0 is just 0, so does not consume other possible lengths
11
+ export type T1c = ArrayLength<string[] | [string, string, string]>; // 0 -- Array -> length: number coerced to length 0 but consumes all other possible lengths
12
+ }
13
+
14
+ declare namespace NotArrayLength {
15
+ export type N = ArrayLength<never>;
16
+ }
@@ -1,19 +1,19 @@
1
- declare type Join<A extends readonly unknown[], D extends string = string> = ArrayType<A> extends never
2
- ? never
3
- : MonadType<A> extends never
4
- ? string
5
- : MonadType<A> extends readonly (infer I extends string)[]
6
- ? [I] extends [stringful]
7
- ? stringful
8
- : Extract<I, stringful> extends never
9
- ? literalful<I> extends never
10
- ? DyadType<MonadType<A>> extends never
11
- ? string
12
- : literalful<D> extends never
13
- ? [D] extends [stringful]
14
- ? stringful
15
- : string
16
- : stringful
17
- : stringful
18
- : stringful
19
- : never;
1
+ declare type Join<A extends readonly unknown[], D extends string = string> = ArrayType<A> extends never
2
+ ? never
3
+ : MonadType<A> extends never
4
+ ? string
5
+ : MonadType<A> extends readonly (infer I extends string)[]
6
+ ? [I] extends [stringful]
7
+ ? stringful
8
+ : Extract<I, stringful> extends never
9
+ ? literalful<I> extends never
10
+ ? DyadType<MonadType<A>> extends never
11
+ ? string
12
+ : literalful<D> extends never
13
+ ? [D] extends [stringful]
14
+ ? stringful
15
+ : string
16
+ : stringful
17
+ : stringful
18
+ : stringful
19
+ : never;
@@ -1,3 +1,3 @@
1
- declare type Unflat<In = string, RO extends boolean = true> = [In] extends [never]
2
- ? never
3
- : In | (True<RO> extends never ? In[] : readonly In[]);
1
+ declare type Unflat<In = string, RO extends boolean = true> = [In] extends [never]
2
+ ? never
3
+ : In | (True<RO> extends never ? In[] : readonly In[]);
@@ -1,30 +1,30 @@
1
- declare type Chain<
2
- A extends readonly string[],
3
- D extends string = "/",
4
- Reverse extends boolean = false,
5
- > = literal<D> extends never
6
- ? never
7
- : D extends D
8
- ? ArrayType<A> extends never
9
- ? never
10
- : ArrayType<A> extends readonly [infer H extends string, ...infer T extends string[]]
11
- ? ArrayType<T> extends readonly []
12
- ? literalful<H>
13
- : True<Reverse> extends never
14
- ? `${literalful<H>}${literal<D>}${Chain<ArrayType<T>, literal<D>>}`
15
- : `${Chain<ArrayType<T>, literal<D>, True<Reverse>>}${literal<D>}${literalful<H>}`
16
- : never
17
- : never;
18
-
19
- declare namespace Chain {
20
- export type T = Chain<["a", "b", "c"]>;
21
- export type T0 = Chain<["a", "b", "c"], "">;
22
- export type T0a = Chain<["a", "b", "c"], "-">;
23
- export type T1 = Chain<["a", "b", "c"], "/", true>;
24
- export type T1a = Chain<["a", "b", "c"], ".", true>;
25
- export type T2 = Chain<["a", "b" | "bar", "c"]>;
26
- export type T2a = Chain<["a" | "foo", "b" | "bar", "c"]>; // 4
27
- export type T3 = Chain<["a", "b", "c"], "." | "/">;
28
- export type T4 = Chain<["a" | "foo", "b" | "bar", "c"], "." | "/">; // 8
29
- export type T5 = Chain<["a" | "foo", "b" | "bar", "c"], "." | "/", true>; // 8
30
- }
1
+ declare type Chain<
2
+ A extends readonly string[],
3
+ D extends string = "/",
4
+ Reverse extends boolean = false,
5
+ > = literal<D> extends never
6
+ ? never
7
+ : D extends D
8
+ ? ArrayType<A> extends never
9
+ ? never
10
+ : ArrayType<A> extends readonly [infer H extends string, ...infer T extends string[]]
11
+ ? ArrayType<T> extends readonly []
12
+ ? literalful<H>
13
+ : True<Reverse> extends never
14
+ ? `${literalful<H>}${literal<D>}${Chain<ArrayType<T>, literal<D>>}`
15
+ : `${Chain<ArrayType<T>, literal<D>, True<Reverse>>}${literal<D>}${literalful<H>}`
16
+ : never
17
+ : never;
18
+
19
+ declare namespace Chain {
20
+ export type T = Chain<["a", "b", "c"]>;
21
+ export type T0 = Chain<["a", "b", "c"], "">;
22
+ export type T0a = Chain<["a", "b", "c"], "-">;
23
+ export type T1 = Chain<["a", "b", "c"], "/", true>;
24
+ export type T1a = Chain<["a", "b", "c"], ".", true>;
25
+ export type T2 = Chain<["a", "b" | "bar", "c"]>;
26
+ export type T2a = Chain<["a" | "foo", "b" | "bar", "c"]>; // 4
27
+ export type T3 = Chain<["a", "b", "c"], "." | "/">;
28
+ export type T4 = Chain<["a" | "foo", "b" | "bar", "c"], "." | "/">; // 8
29
+ export type T5 = Chain<["a" | "foo", "b" | "bar", "c"], "." | "/", true>; // 8
30
+ }
@@ -1,3 +1,3 @@
1
- declare type PathN<C, N extends number = 0> = Stringify<C> extends never
2
- ? never
3
- : ArrayN<Stringify<C>, N>;
1
+ declare type PathN<C, N extends number = 0> = Stringify<C> extends never
2
+ ? never
3
+ : ArrayN<Stringify<C>, N>;
@@ -1,5 +1,5 @@
1
- declare type Stringify<C> = C extends Record<"string", infer S extends string>
2
- ? S
3
- : C extends Record<"toString", infer Fn extends ()=> string>
4
- ? ReturnType<Fn>
5
- : never;
1
+ declare type Stringify<C> = C extends Record<"string", infer S extends string>
2
+ ? S
3
+ : C extends Record<"toString", infer Fn extends ()=> string>
4
+ ? ReturnType<Fn>
5
+ : never;
@@ -1,35 +1,35 @@
1
- declare type Length<N extends number> = [N] extends [number]
2
- ? [number] extends [N]
3
- ? 0
4
- : Numbered<N>
5
- : never;
6
-
7
- declare namespace Length {
8
- export type T0 = Length<0>;
9
- export type T0a = Length<0.0>; // 0
10
- export type T0b = Length<number>; // 0
11
- export type T1 = Length<1>;
12
- export type T1a = Length<1.0>; // 1
13
- export type T2 = Length<1.1>; // 1.1
14
- export type T3 = Length<1 | 5>; // 1 | 5
15
- export type T3b = Length<0 | 1 | 5>; // 0 | 1 | 5
16
- }
17
-
18
- declare namespace NotLength {
19
- export type N = Length<never>;
20
-
21
- // export type N0 = Length<unknown>;
22
- // export type N0a = Length<undefined>;
23
- // export type N0b = Length<null>;
24
- // export type N0c = Length<void>;
25
- // export type N0d = Length<undefined>;
26
- // export type N0e = Length<undefined>;
27
- // export type N1 = Length<"1">;
28
- // export type N1a = Length<true>;
29
- // export type N1b = Length<[5, 5]>;
30
- // export type N1c = Length<()=> void>;
31
- // export type N1d = Length<object>;
32
- // export type N2 = Length<null | 1>;
33
- // export type N2a = Length<true | 1>;
34
- // export type N2b = Length<number | 1>; // 0
35
- }
1
+ declare type Length<N extends number> = [N] extends [number]
2
+ ? [number] extends [N]
3
+ ? 0
4
+ : Numbered<N>
5
+ : never;
6
+
7
+ declare namespace Length {
8
+ export type T0 = Length<0>;
9
+ export type T0a = Length<0.0>; // 0
10
+ export type T0b = Length<number>; // 0
11
+ export type T1 = Length<1>;
12
+ export type T1a = Length<1.0>; // 1
13
+ export type T2 = Length<1.1>; // 1.1
14
+ export type T3 = Length<1 | 5>; // 1 | 5
15
+ export type T3b = Length<0 | 1 | 5>; // 0 | 1 | 5
16
+ }
17
+
18
+ declare namespace NotLength {
19
+ export type N = Length<never>;
20
+
21
+ // export type N0 = Length<unknown>;
22
+ // export type N0a = Length<undefined>;
23
+ // export type N0b = Length<null>;
24
+ // export type N0c = Length<void>;
25
+ // export type N0d = Length<undefined>;
26
+ // export type N0e = Length<undefined>;
27
+ // export type N1 = Length<"1">;
28
+ // export type N1a = Length<true>;
29
+ // export type N1b = Length<[5, 5]>;
30
+ // export type N1c = Length<()=> void>;
31
+ // export type N1d = Length<object>;
32
+ // export type N2 = Length<null | 1>;
33
+ // export type N2a = Length<true | 1>;
34
+ // export type N2b = Length<number | 1>; // 0
35
+ }
@@ -1 +1 @@
1
- declare type Null<T> = null | T;
1
+ declare type Null<T> = null | T;
@@ -1 +1 @@
1
- declare type Nullable<T> = Null<NonNullable<T>>;
1
+ declare type Nullable<T> = Null<NonNullable<T>>;