@eslinted/core 8.0.0 → 9.0.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.
Files changed (114) hide show
  1. package/.github/workflows/RELEASE.yml +36 -36
  2. package/.github/workflows/rc.yml +36 -36
  3. package/.markdownlint.jsonc +122 -122
  4. package/LICENSE +21 -21
  5. package/README.md +5 -5
  6. package/SECURITY.md +9 -9
  7. package/eslint.config.js +3 -3
  8. package/package.json +96 -96
  9. package/src/factory/files.ts +26 -26
  10. package/src/factory/index.ts +27 -27
  11. package/src/factory/options/html.ts +18 -18
  12. package/src/factory/options/index.ts +21 -21
  13. package/src/factory/options/js.ts +13 -13
  14. package/src/factory/options/json.ts +18 -18
  15. package/src/factory/options/jsonc.ts +18 -18
  16. package/src/factory/options/mocha.ts +28 -28
  17. package/src/factory/options/option/index.ts +91 -91
  18. package/src/factory/options/option/template/globals.ts +5 -5
  19. package/src/factory/options/option/template/index.ts +26 -26
  20. package/src/factory/options/option/template/language/ecma.ts +3 -3
  21. package/src/factory/options/option/template/language/index.ts +21 -21
  22. package/src/factory/options/option/template/language/source.ts +4 -4
  23. package/src/factory/options/option/template/linter.ts +8 -8
  24. package/src/factory/options/option/template/plugins.ts +1 -1
  25. package/src/factory/options/svelte.ts +32 -32
  26. package/src/factory/options/ts.ts +24 -24
  27. package/src/factory/options/yml.ts +18 -18
  28. package/src/factory/rulesets/index.ts +24 -24
  29. package/src/factory/rulesets/ruleset.ts +25 -25
  30. package/src/index.ts +77 -77
  31. package/src/input/files.ts +6 -6
  32. package/src/input/imports/parsers.ts +10 -10
  33. package/src/input/imports/plugins.ts +9 -9
  34. package/src/input/index.ts +23 -23
  35. package/src/input/parsers.ts +3 -3
  36. package/src/input/plugins.ts +3 -3
  37. package/src/input/rules/entry/index.ts +7 -7
  38. package/src/input/rules/entry/record/index.ts +3 -3
  39. package/src/input/rules/entry/record/state.ts +5 -5
  40. package/src/input/rules/index.ts +14 -14
  41. package/src/output.ts +24 -24
  42. package/src/scopes.spec.ts +37 -37
  43. package/src/scopes.ts +11 -11
  44. package/tsconfig.json +163 -163
  45. package/typings/common/literals/number/bases/base32.d.ts +19 -19
  46. package/typings/common/literals/number/bases/base64.d.ts +35 -35
  47. package/typings/common/literals/number/bases/binary.d.ts +4 -4
  48. package/typings/common/literals/number/bases/decimal.d.ts +5 -5
  49. package/typings/common/literals/number/bases/hex.d.ts +10 -10
  50. package/typings/common/literals/number/bases/octal.d.ts +7 -7
  51. package/typings/common/literals/number/bases/quatral.d.ts +4 -4
  52. package/typings/common/literals/number/bases/ternary.d.ts +4 -4
  53. package/typings/common/literals/string/letter/digit/extended/base64/index.d.ts +13 -13
  54. package/typings/common/literals/string/letter/digit/extended/hex/index.d.ts +9 -9
  55. package/typings/common/literals/string/letter/digit/index.d.ts +12 -12
  56. package/typings/common/literals/string/letter/index.d.ts +35 -35
  57. package/typings/common/primitive/index.d.ts +5 -5
  58. package/typings/common/safe/index.d.ts +2 -2
  59. package/typings/common/safe/numbers/finite/index.d.ts +2 -2
  60. package/typings/common/safe/numbers/fint.d.ts +1 -1
  61. package/typings/common/safe/numbers/integer/index.d.ts +2 -2
  62. package/typings/common/safe/numbers/integer/numberful/index.d.ts +1 -1
  63. package/typings/common/safe/numbers/polarity/negative.d.ts +4 -4
  64. package/typings/common/safe/numbers/polarity/pole/index.d.ts +18 -18
  65. package/typings/common/safe/numbers/polarity/positive.d.ts +4 -4
  66. package/typings/common/safe/strings/char.d.ts +1 -1
  67. package/typings/common/safe/strings/stringful/index.d.ts +1 -1
  68. package/typings/common/safe/strings/stringful/length/index.d.ts +3 -3
  69. package/typings/common/utility/interface/build/particord/index.d.ts +1 -1
  70. package/typings/common/utility/interface/build/properties/Field.d.ts +1 -1
  71. package/typings/common/utility/interface/build/properties/Flag.d.ts +1 -1
  72. package/typings/common/utility/interface/build/properties/Limit.d.ts +8 -8
  73. package/typings/common/utility/interface/build/properties/List.d.ts +1 -1
  74. package/typings/common/utility/interface/build/properties/Listish.d.ts +1 -1
  75. package/typings/common/utility/interface/build/properties/Scalar.d.ts +1 -1
  76. package/typings/common/utility/interface/build/properties/property/index.d.ts +8 -8
  77. package/typings/common/utility/interface/build/recordful/index.d.ts +5 -5
  78. package/typings/common/utility/interface/build/tables/FieldTable.d.ts +1 -1
  79. package/typings/common/utility/interface/build/tables/FlagTable.d.ts +1 -1
  80. package/typings/common/utility/interface/build/tables/ListTable.d.ts +1 -1
  81. package/typings/common/utility/interface/build/tables/ListishTable.d.ts +1 -1
  82. package/typings/common/utility/interface/build/tables/ScalarTable.d.ts +1 -1
  83. package/typings/common/utility/interface/build/tables/table/index.d.ts +3 -3
  84. package/typings/common/utility/interface/identity/interface/index.d.ts +80 -80
  85. package/typings/common/utility/interface/identity/keys/index.d.ts +71 -71
  86. package/typings/common/utility/interface/transform/partial/unrequire/index.d.ts +45 -45
  87. package/typings/common/utility/iterable/build/arrays/array/index.d.ts +11 -11
  88. package/typings/common/utility/iterable/build/arrays/index.d.ts +2 -2
  89. package/typings/common/utility/iterable/build/tuples/index.d.ts +10 -10
  90. package/typings/common/utility/iterable/build/tuples/tuple/index.d.ts +26 -26
  91. package/typings/common/utility/iterable/identity/array/index.d.ts +65 -65
  92. package/typings/common/utility/iterable/identity/array/length/index.d.ts +16 -16
  93. package/typings/common/utility/iterable/identity/dyad.d.ts +3 -3
  94. package/typings/common/utility/iterable/identity/monad.d.ts +48 -48
  95. package/typings/common/utility/iterable/identity/triad.d.ts +3 -3
  96. package/typings/common/utility/iterable/transform/flat/index.d.ts +3 -3
  97. package/typings/common/utility/iterable/transform/flat/unflat/index.d.ts +3 -3
  98. package/typings/common/utility/iterable/transform/string/index.d.ts +30 -30
  99. package/typings/common/utility/iterable/transform/string/stringify/index.d.ts +27 -27
  100. package/typings/common/utility/nullable/index.d.ts +1 -1
  101. package/typings/common/utility/nullable/index.spec.d.ts +13 -13
  102. package/typings/common/utility/nullable/null/index.d.ts +1 -1
  103. package/typings/common/utility/nullable/null/index.spec.d.ts +13 -13
  104. package/typings/common/utility/object/build/index.d.ts +3 -3
  105. package/typings/common/utility/primitive/boolean/true/index.d.ts +30 -30
  106. package/typings/common/utility/primitive/index.d.ts +42 -42
  107. package/typings/common/utility/primitive/number/length/index.d.ts +35 -35
  108. package/typings/common/utility/primitive/number/length/numbered/index.d.ts +35 -35
  109. package/typings/common/utility/primitive/string/fake/index.d.ts +1 -1
  110. package/typings/common/utility/primitive/string/literalful/index.d.ts +28 -28
  111. package/typings/common/utility/primitive/string/literalful/literal/index.d.ts +22 -22
  112. package/typings/common/utility/test.d.ts +2 -2
  113. package/typings/common/valid/index.d.ts +7 -7
  114. package/typings/common/valid/string/index.d.ts +1 -1
@@ -1,10 +1,10 @@
1
- declare type Monad<I = string> = Tuple<1, I>;
2
- declare type Dyad<I = string> = Tuple<2, I>;
3
- declare type Triad<I = string> = Tuple<3, I>;
4
- declare type Quad<I = string> = Tuple<4, I>;
5
- declare type Pentad<I = string> = Tuple<5, I>;
6
- declare type Hexad<I = string> = Tuple<6, I>;
7
- declare type Heptad<I = string> = Tuple<7, I>;
8
- declare type Octad<I = string> = Tuple<8, I>;
9
- declare type Nonad<I = string> = Tuple<9, I>;
10
- declare type Decad<I = string> = Tuple<10, I>;
1
+ declare type Monad<I = string> = Tuple<1, I>;
2
+ declare type Dyad<I = string> = Tuple<2, I>;
3
+ declare type Triad<I = string> = Tuple<3, I>;
4
+ declare type Quad<I = string> = Tuple<4, I>;
5
+ declare type Pentad<I = string> = Tuple<5, I>;
6
+ declare type Hexad<I = string> = Tuple<6, I>;
7
+ declare type Heptad<I = string> = Tuple<7, I>;
8
+ declare type Octad<I = string> = Tuple<8, I>;
9
+ declare type Nonad<I = string> = Tuple<9, I>;
10
+ declare type Decad<I = string> = Tuple<10, I>;
@@ -1,26 +1,26 @@
1
- declare type Tuple<N extends number = 2, I = string> = [I] extends [never]
2
- ? never
3
- : N extends number
4
- ? N extends 0 /* TODO: constrain posint */
5
- ? readonly []
6
- : TupleBuilder<N, I>
7
- : never;
8
-
9
- type TupleBuilder<N extends number, I, H extends readonly I[] = readonly []> = H["length"] extends N
10
- ? H
11
- : TupleBuilder<N, I, readonly [...H, I]>;
12
-
13
- declare namespace Tuple {
14
- export type T = Tuple;
15
- export type T0 = Tuple<0>;
16
- export type T0a = Tuple<1>;
17
- export type T0b = Tuple<3>;
18
- export type T1 = Tuple<2, string | number>;
19
- export type T2 = Tuple<2 | 3>;
20
- export type T3 = Tuple<2 | 3, string | number>;
21
- export type T4 = Tuple<never>;
22
- export type T4a = Tuple<0>;
23
- export type T4b = Tuple<0 | 1>;
24
- export type T4c = Tuple<1, never>;
25
- export type T4d = Tuple<never, never>;
26
- }
1
+ declare type Tuple<N extends number = 2, I = string> = [I] extends [never]
2
+ ? never
3
+ : N extends number
4
+ ? N extends 0 /* TODO: constrain posint */
5
+ ? readonly []
6
+ : TupleBuilder<N, I>
7
+ : never;
8
+
9
+ type TupleBuilder<N extends number, I, H extends readonly I[] = readonly []> = H["length"] extends N
10
+ ? H
11
+ : TupleBuilder<N, I, readonly [...H, I]>;
12
+
13
+ declare namespace Tuple {
14
+ export type T = Tuple;
15
+ export type T0 = Tuple<0>;
16
+ export type T0a = Tuple<1>;
17
+ export type T0b = Tuple<3>;
18
+ export type T1 = Tuple<2, string | number>;
19
+ export type T2 = Tuple<2 | 3>;
20
+ export type T3 = Tuple<2 | 3, string | number>;
21
+ export type T4 = Tuple<never>;
22
+ export type T4a = Tuple<0>;
23
+ export type T4b = Tuple<0 | 1>;
24
+ export type T4c = Tuple<1, never>;
25
+ export type T4d = Tuple<never, never>;
26
+ }
@@ -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[]> = LengthValue<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[]> = LengthValue<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,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>;
16
- export type T8b = MonadType<ArrayN<3>>;
17
- export type T8c = MonadType<
18
- | ArrayN<3>
19
- | Tuple
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>;
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>;
16
+ export type T8b = MonadType<ArrayN<3>>;
17
+ export type T8c = MonadType<
18
+ | ArrayN<3>
19
+ | Tuple
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>;
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,3 +1,3 @@
1
- declare type Flat<A extends readonly unknown[]> = A extends readonly (infer B)[]
2
- ? B
3
- : never;
1
+ declare type Flat<A extends readonly unknown[]> = A extends readonly (infer B)[]
2
+ ? B
3
+ : 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,27 +1,27 @@
1
- declare type Stringify<C> = C extends abstract new (...args: infer A) => infer O
2
- ? O extends { string: infer S extends string }
3
- ? S
4
- : O extends { toString: () => infer S extends string }
5
- ? S
6
- : never
7
- : C extends ((...args: infer A) => infer S extends string)
8
- ? S
9
- : C extends { string: infer S extends string }
10
- ? S
11
- : C extends { toString: () => infer S extends string }
12
- ? S
13
- : never;
14
-
15
- declare namespace Stringify {
16
- export type T = Stringify<CharString<"OK-Instance">>;
17
- export type T0 = Stringify<CharStringCtor>;
18
- export type T1 = Stringify<charstringfunc<"OK-Function">>;
19
-
20
- type CharStringCtor = abstract new () => CharString<"OK-Constructor">;
21
-
22
- interface CharString<Validator extends string> {
23
- readonly string: valid<stringful, [Validator, "string"]>;
24
- }
25
-
26
- type charstringfunc<Validator extends string> = () => valid<stringful, [Validator, "string"]>;
27
- }
1
+ declare type Stringify<C> = C extends abstract new (...args: infer A) => infer O
2
+ ? O extends { string: infer S extends string }
3
+ ? S
4
+ : O extends { toString: () => infer S extends string }
5
+ ? S
6
+ : never
7
+ : C extends ((...args: infer A) => infer S extends string)
8
+ ? S
9
+ : C extends { string: infer S extends string }
10
+ ? S
11
+ : C extends { toString: () => infer S extends string }
12
+ ? S
13
+ : never;
14
+
15
+ declare namespace Stringify {
16
+ export type T = Stringify<CharString<"OK-Instance">>;
17
+ export type T0 = Stringify<CharStringCtor>;
18
+ export type T1 = Stringify<charstringfunc<"OK-Function">>;
19
+
20
+ type CharStringCtor = abstract new () => CharString<"OK-Constructor">;
21
+
22
+ interface CharString<Validator extends string> {
23
+ readonly string: valid<stringful, [Validator, "string"]>;
24
+ }
25
+
26
+ type charstringfunc<Validator extends string> = () => valid<stringful, [Validator, "string"]>;
27
+ }
@@ -1 +1 @@
1
- declare type Nullable<T> = Null<NonNullable<T>>;
1
+ declare type Nullable<T> = Null<NonNullable<T>>;
@@ -1,13 +1,13 @@
1
- declare namespace Nullable {
2
- type OK = Test<TF> | 0;
3
- type TF = {
4
- T: {
5
- T0: Nullable<string>;
6
- T1: Nullable<string | null>;
7
- T2: Nullable<string | undefined>;
8
- T3: Nullable<string | null | undefined>;
9
- T4: Nullable<string | int | null>;
10
- T6: Nullable<NonNullable<undefined | string>>;
11
- };
12
- };
13
- }
1
+ declare namespace Nullable {
2
+ type OK = Test<TF> | 0;
3
+ type TF = {
4
+ T: {
5
+ T0: Nullable<string>;
6
+ T1: Nullable<string | null>;
7
+ T2: Nullable<string | undefined>;
8
+ T3: Nullable<string | null | undefined>;
9
+ T4: Nullable<string | int | null>;
10
+ T6: Nullable<NonNullable<undefined | string>>;
11
+ };
12
+ };
13
+ }
@@ -1 +1 @@
1
- declare type Null<T> = null | T;
1
+ declare type Null<T> = null | T;
@@ -1,13 +1,13 @@
1
- declare namespace _Null {
2
- type OK = Test<TF> | 0;
3
- type TF = {
4
- T: {
5
- T0: Null<string>;
6
- T1: Null<string | null>;
7
- T2: Null<string | undefined>;
8
- T3: Null<string | null | undefined>;
9
- T4: Null<string | int | null>;
10
- T6: Null<NonNullable<undefined | string>>;
11
- };
12
- };
13
- }
1
+ declare namespace _Null {
2
+ type OK = Test<TF> | 0;
3
+ type TF = {
4
+ T: {
5
+ T0: Null<string>;
6
+ T1: Null<string | null>;
7
+ T2: Null<string | undefined>;
8
+ T3: Null<string | null | undefined>;
9
+ T4: Null<string | int | null>;
10
+ T6: Null<NonNullable<undefined | string>>;
11
+ };
12
+ };
13
+ }
@@ -1,3 +1,3 @@
1
- declare type Constructor<C> = C extends abstract new (...args: infer A) => infer O
2
- ? new (...args: A) => O
3
- : never;
1
+ declare type Constructor<C> = C extends abstract new (...args: infer A) => infer O
2
+ ? new (...args: A) => O
3
+ : never;
@@ -1,30 +1,30 @@
1
- declare type True<B extends boolean> = true extends Primeval<B, boolean>
2
- ? Primeval<B, boolean>
3
- : never;
4
-
5
- declare namespace True {
6
- export type T0 = True<true>;
7
- }
8
-
9
- declare namespace NotTrue {
10
-
11
- export type N0 = True<never>;
12
- export type N1 = True<false>;
13
- export type N1a = True<false | true>;
14
- export type N1b = True<boolean>;
15
-
16
- // export type N2 = True<true | 10>;
17
- // export type N2a = True<true | object>;
18
- // export type N2b = True<true | undefined>;
19
- // export type N2c = True<true | null>;
20
- // export type N2d = True<0>;
21
- // export type N2e = True<1>;
22
- // export type N2f = True<number>;
23
- // export type N2g = True<"">;
24
- // export type N2h = True<"true">;
25
- // export type N2i = True<"foo">;
26
- // export type N2j = True<null>;
27
- // export type N2k = True<undefined>;
28
- // export type N2l = True<[]>;
29
- // export type N2m = True<object>;
30
- }
1
+ declare type True<B extends boolean> = true extends Primeval<B, boolean>
2
+ ? Primeval<B, boolean>
3
+ : never;
4
+
5
+ declare namespace True {
6
+ export type T0 = True<true>;
7
+ }
8
+
9
+ declare namespace NotTrue {
10
+
11
+ export type N0 = True<never>;
12
+ export type N1 = True<false>;
13
+ export type N1a = True<false | true>;
14
+ export type N1b = True<boolean>;
15
+
16
+ // export type N2 = True<true | 10>;
17
+ // export type N2a = True<true | object>;
18
+ // export type N2b = True<true | undefined>;
19
+ // export type N2c = True<true | null>;
20
+ // export type N2d = True<0>;
21
+ // export type N2e = True<1>;
22
+ // export type N2f = True<number>;
23
+ // export type N2g = True<"">;
24
+ // export type N2h = True<"true">;
25
+ // export type N2i = True<"foo">;
26
+ // export type N2j = True<null>;
27
+ // export type N2k = True<undefined>;
28
+ // export type N2l = True<[]>;
29
+ // export type N2m = True<object>;
30
+ }