@eslinted/core 3.1.12 → 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 +1 @@
1
- declare type fint = Finite<int>;
1
+ declare type fint = Finite<int>;
@@ -1,2 +1,2 @@
1
- declare const int: unique symbol;
2
- declare type Int<N extends number> = N & { [int]: 1 };
1
+ declare const int: unique symbol;
2
+ declare type Int<N extends number> = N & { [int]: 1 };
@@ -1 +1 @@
1
- declare type int = Int<numberful>;
1
+ declare type int = Int<numberful>;
@@ -1 +1 @@
1
- declare type numberful = Safe<number, "numberful">;
1
+ declare type numberful = Safe<number, "numberful">;
@@ -1,4 +1,4 @@
1
- declare type Negative<
2
- N extends number,
3
- Zero = true,
4
- > = Pole<N, "-", Zero>;
1
+ declare type Negative<
2
+ N extends number,
3
+ Zero = true,
4
+ > = Pole<N, "-", Zero>;
@@ -1,4 +1,4 @@
1
- declare type Positive<
2
- N extends number,
3
- Zero = true,
4
- > = Pole<N, "+", Zero>;
1
+ declare type Positive<
2
+ N extends number,
3
+ Zero = true,
4
+ > = Pole<N, "+", Zero>;
@@ -1,18 +1,18 @@
1
- declare const pole: unique symbol;
2
- declare const min: unique symbol;
3
- declare type Pole<
4
- N extends number,
5
- P extends
6
- | "-"
7
- | "+"
8
- ,
9
- Zero,
10
- > =
11
- & N
12
- & {
13
- [pole]: P;
14
- [min]: Zero extends false
15
- ? P extends "+" ? 1 : -1
16
- : 0;
17
- }
18
- ;
1
+ declare const pole: unique symbol;
2
+ declare const min: unique symbol;
3
+ declare type Pole<
4
+ N extends number,
5
+ P extends
6
+ | "-"
7
+ | "+"
8
+ ,
9
+ Zero,
10
+ > =
11
+ & N
12
+ & {
13
+ [pole]: P;
14
+ [min]: Zero extends false
15
+ ? P extends "+" ? 1 : -1
16
+ : 0;
17
+ }
18
+ ;
@@ -1,5 +1,5 @@
1
- declare type primitive =
2
- | string
3
- | number
4
- | boolean
5
- ;
1
+ declare type primitive =
2
+ | string
3
+ | number
4
+ | boolean
5
+ ;
@@ -1 +1 @@
1
- declare type char = stringful & PropLength<1>;
1
+ declare type char = stringful & PropLength<1>;
@@ -1,3 +1,3 @@
1
- declare type PropLength<L extends number> = Length<L> extends never
2
- ? never
3
- : { length: Length<L> };
1
+ declare type PropLength<L extends number> = Length<L> extends never
2
+ ? never
3
+ : { length: Length<L> };
@@ -1 +1 @@
1
- declare type stringful = Safe<string, "stringful"> & { 0: stringful & PropLength<1> };
1
+ declare type stringful = Safe<string, "stringful"> & { 0: stringful & PropLength<1> };
@@ -1 +1 @@
1
- declare type Particord<K extends string, V> = Partial<Recordful<K, V>>;
1
+ declare type Particord<K extends string, V> = Partial<Recordful<K, V>>;
@@ -1,8 +1,8 @@
1
- declare type Property<K extends string, OK extends string, V> = literalful<K> extends never
2
- ? Particord<OK, V>
3
- : Recordful<K, V>
4
- & (
5
- literalful<OK> extends never
6
- ? object
7
- : Particord<OK, V>
8
- );
1
+ declare type Property<K extends string, OK extends string, V> = literalful<K> extends never
2
+ ? Particord<OK, V>
3
+ : Recordful<K, V>
4
+ & (
5
+ literalful<OK> extends never
6
+ ? object
7
+ : Particord<OK, V>
8
+ );
@@ -1,5 +1,5 @@
1
- declare type Recordful<K extends string, V> = [V] extends [never]
2
- ? never
3
- : literalful<K> extends never
4
- ? never
5
- : Record<literalful<K>, V>;
1
+ declare type Recordful<K extends string, V> = [V] extends [never]
2
+ ? never
3
+ : literalful<K> extends never
4
+ ? never
5
+ : Record<literalful<K>, V>;
@@ -1,3 +1,3 @@
1
- declare type Table<V = unknown> = [V] extends [never]
2
- ? never
3
- : Record<string, V>;
1
+ declare type Table<V = unknown> = [V] extends [never]
2
+ ? never
3
+ : Record<string, V>;
@@ -1 +1 @@
1
- declare type Field<K extends string, OK extends string = never> = Property<K, OK, string>;
1
+ declare type Field<K extends string, OK extends string = never> = Property<K, OK, string>;
@@ -1 +1 @@
1
- declare type Flag<OK extends string, K extends string = never> = Property<K, OK, boolean>;
1
+ declare type Flag<OK extends string, K extends string = never> = Property<K, OK, boolean>;
@@ -1,8 +1,8 @@
1
- declare type Limit<K extends string, OK extends string = never> = Property<K, OK, Boundary>;
2
-
3
- type Boundary = Recordful<
4
- | "min"
5
- | "max"
6
- ,
7
- number
8
- >;
1
+ declare type Limit<K extends string, OK extends string = never> = Property<K, OK, Boundary>;
2
+
3
+ type Boundary = Recordful<
4
+ | "min"
5
+ | "max"
6
+ ,
7
+ number
8
+ >;
@@ -1 +1 @@
1
- declare type List<K extends string, OK extends string = never> = Property<K, OK, readonly string[]>;
1
+ declare type List<K extends string, OK extends string = never> = Property<K, OK, readonly string[]>;
@@ -1 +1 @@
1
- declare type Listish<K extends string, OK extends string = never> = Property<K, OK, Unflat>;
1
+ declare type Listish<K extends string, OK extends string = never> = Property<K, OK, Unflat>;
@@ -1 +1 @@
1
- declare type Scalar<K extends string, OK extends string = never> = Property<K, OK, number>;
1
+ declare type Scalar<K extends string, OK extends string = never> = Property<K, OK, number>;
@@ -1 +1 @@
1
- declare type FieldTable = Table<string>;
1
+ declare type FieldTable = Table<string>;
@@ -1 +1 @@
1
- declare type FlagTable = Table<boolean>;
1
+ declare type FlagTable = Table<boolean>;
@@ -1 +1 @@
1
- declare type ListTable = Table<readonly string[]>;
1
+ declare type ListTable = Table<readonly string[]>;
@@ -1 +1 @@
1
- declare type ListishTable = Table<Unflat>;
1
+ declare type ListishTable = Table<Unflat>;
@@ -1 +1 @@
1
- declare type ScalarTable = Table<number>;
1
+ declare type ScalarTable = Table<number>;
@@ -1,80 +1,80 @@
1
- declare type Interface<R extends object> = [R] extends [object]
2
- ? [Extract<R, readonly unknown[]>] extends [never]
3
- ? Required<R> extends Record<infer K, unknown>
4
- ? Exclude<K, string> extends never
5
- ? literalful<K & string> extends never
6
- ? never
7
- : R
8
- : never
9
- : never
10
- : never
11
- : never;
12
-
13
- declare namespace InterfaceTest {
14
- export type T = Interface<{ a: 5 }>;
15
- export type T0 = Interface<{
16
- a: 1;
17
- b?: 2;
18
- }>;
19
- export type T1 = Interface<{
20
- a: 1;
21
- b: 2;
22
- }>;
23
- export type T2 = Interface<Record<"a", unknown>>;
24
- export type T3 = Interface<Record<"a" | "b", unknown>>;
25
- }
26
-
27
- declare namespace NotInterface {
28
- export type N = Interface<never>;
29
- export type N0 = Interface<object>;
30
- export type N0a = Interface<Record<"a" | "b" | 5, unknown>>;
31
- export type N0b = Interface<Record<"a" | "b" | number, unknown>>;
32
- export type N0c = Interface<Record<string, unknown>>;
33
- export type N0d = Interface<Record<string | number, unknown>>;
34
- export type N0e = Interface<Record<stringful, string>>;
35
- export type N0f = Interface<Record<stringful | "5", string>>;
36
- export type N1 = Interface<[]>;
37
- export type N1b = Interface<[1]>;
38
- export type N1c = Interface<[1, 1]>;
39
- export type N1d = Interface<number[]>;
40
- export type N1e = Interface<readonly []>;
41
- export type N1f = Interface<readonly [1]>;
42
- export type N1g = Interface<readonly [1, 1]>;
43
- export type N1h = Interface<readonly number[]>;
44
- export type N2 = Interface<()=> void>;
45
- export type N2a = Interface<(a: string)=> boolean>;
46
- export type N2b = Interface<(a: string)=> string[]>;
47
- export type N2c = Interface<(a: string)=> object>;
48
- export type N5 = Interface<[] | { a: 1 }>;
49
- export type N5a = Interface<[30] | { a: 1 }>;
50
- export type N5b = Interface<object | []>;
51
- export type N5c = Interface<
52
- | {
53
- a: 1;
54
- b: 2;
55
- }
56
- | {
57
- a: 1;
58
- b: 2;
59
- c: 2;
60
- }
61
- >;
62
-
63
- // export type N3 = Interface<stringful>;
64
- // export type N3b = Interface<numberful>;
65
- // export type N13c = Interface<string>;
66
- // export type N13d = Interface<"cool">;
67
- // export type N13e = Interface<number>;
68
- // export type N13f = Interface<0>;
69
- // export type N13g = Interface<1>;
70
- // export type N13h = Interface<true>;
71
- // export type N13i = Interface<false>;
72
- // export type N13j = Interface<boolean>;
73
- // export type N14 = Interface<null>;
74
- // export type N14a = Interface<undefined>;
75
- // export type N14c = Interface<unknown>;
76
- // export type N15 = Interface<string | { a: cool }>;
77
- // export type N15b = Interface<Record<"a" | "b" | string, unknown>>;
78
- }
79
-
80
- type gg = Extract<{ a: 5 }, readonly unknown[]>;
1
+ declare type Interface<R extends object> = [R] extends [object]
2
+ ? [Extract<R, readonly unknown[]>] extends [never]
3
+ ? Required<R> extends Record<infer K, unknown>
4
+ ? Exclude<K, string> extends never
5
+ ? literalful<K & string> extends never
6
+ ? never
7
+ : R
8
+ : never
9
+ : never
10
+ : never
11
+ : never;
12
+
13
+ declare namespace InterfaceTest {
14
+ export type T = Interface<{ a: 5 }>;
15
+ export type T0 = Interface<{
16
+ a: 1;
17
+ b?: 2;
18
+ }>;
19
+ export type T1 = Interface<{
20
+ a: 1;
21
+ b: 2;
22
+ }>;
23
+ export type T2 = Interface<Record<"a", unknown>>;
24
+ export type T3 = Interface<Record<"a" | "b", unknown>>;
25
+ }
26
+
27
+ declare namespace NotInterface {
28
+ export type N = Interface<never>;
29
+ export type N0 = Interface<object>;
30
+ export type N0a = Interface<Record<"a" | "b" | 5, unknown>>;
31
+ export type N0b = Interface<Record<"a" | "b" | number, unknown>>;
32
+ export type N0c = Interface<Record<string, unknown>>;
33
+ export type N0d = Interface<Record<string | number, unknown>>;
34
+ export type N0e = Interface<Record<stringful, string>>;
35
+ export type N0f = Interface<Record<stringful | "5", string>>;
36
+ export type N1 = Interface<[]>;
37
+ export type N1b = Interface<[1]>;
38
+ export type N1c = Interface<[1, 1]>;
39
+ export type N1d = Interface<number[]>;
40
+ export type N1e = Interface<readonly []>;
41
+ export type N1f = Interface<readonly [1]>;
42
+ export type N1g = Interface<readonly [1, 1]>;
43
+ export type N1h = Interface<readonly number[]>;
44
+ export type N2 = Interface<()=> void>;
45
+ export type N2a = Interface<(a: string)=> boolean>;
46
+ export type N2b = Interface<(a: string)=> string[]>;
47
+ export type N2c = Interface<(a: string)=> object>;
48
+ export type N5 = Interface<[] | { a: 1 }>;
49
+ export type N5a = Interface<[30] | { a: 1 }>;
50
+ export type N5b = Interface<object | []>;
51
+ export type N5c = Interface<
52
+ | {
53
+ a: 1;
54
+ b: 2;
55
+ }
56
+ | {
57
+ a: 1;
58
+ b: 2;
59
+ c: 2;
60
+ }
61
+ >;
62
+
63
+ // export type N3 = Interface<stringful>;
64
+ // export type N3b = Interface<numberful>;
65
+ // export type N13c = Interface<string>;
66
+ // export type N13d = Interface<"cool">;
67
+ // export type N13e = Interface<number>;
68
+ // export type N13f = Interface<0>;
69
+ // export type N13g = Interface<1>;
70
+ // export type N13h = Interface<true>;
71
+ // export type N13i = Interface<false>;
72
+ // export type N13j = Interface<boolean>;
73
+ // export type N14 = Interface<null>;
74
+ // export type N14a = Interface<undefined>;
75
+ // export type N14c = Interface<unknown>;
76
+ // export type N15 = Interface<string | { a: cool }>;
77
+ // export type N15b = Interface<Record<"a" | "b" | string, unknown>>;
78
+ }
79
+
80
+ type gg = Extract<{ a: 5 }, readonly unknown[]>;
@@ -1,71 +1,71 @@
1
- declare type Keys<R extends object> = Interface<R> extends never
2
- ? never
3
- : keyof Interface<R>;
4
-
5
- declare namespace Keys {
6
- const RESULT: {
7
- positive: typeof POSITIVE | 1;
8
- negative: typeof NEGATIVE | 0;
9
- };
10
-
11
- export const POSITIVE: {
12
- T: Keys<{ a: 5 }>;
13
- T0: Keys<{
14
- a: 1;
15
- b?: 2;
16
- }>;
17
- T1: Keys<{
18
- a: 1;
19
- b: 2;
20
- }>;
21
- } extends Record<string, string> ? "PASS" : never;
22
- const s: unique symbol;
23
-
24
- export const NEGATIVE: {
25
- N: Keys<never>;
26
- N0: Keys<{ [s]: 1 }>;
27
- N1: Keys<Record<string, 1>>;
28
- N1b: Keys<Record<stringful, 1>>;
29
- N1c: Keys<Record<"", 1>>;
30
- N1d: Keys<Record<number, 1>>;
31
- N2: Keys<Record<stringful | "30", 1>>;
32
- N2b: Keys<Record<stringful | "", 1>>;
33
- N2c: Keys<Record<number | "", 1>>;
34
- N2d: Keys<Record<number | "c", 1>>;
35
- N2e: Keys<object>;
36
- N2f: Keys<{
37
- a: 1;
38
- [min]: 1;
39
- }>;
40
- N3: Keys<[]>;
41
- N3a: Keys<readonly [1, 1]>;
42
- N4: Keys<
43
- | {
44
- a: 1;
45
- b: 1;
46
- }
47
- | object
48
- >;
49
- N5: Keys<[1] | { a: 1 }>;
50
- N5a: Keys<
51
- | {
52
- a: 1;
53
- b: 1;
54
- }
55
- | { c: 1 }
56
- >;
57
- N5b: Keys<
58
- | {
59
- a: 1;
60
- b: 1;
61
- }
62
- | { c?: 1 }
63
- >;
64
-
65
- // N10: Keys<null>;
66
- // N10a: Keys<undefined>;
67
- // N10b: Keys<void>;
68
- // N10c: Keys<unknown>;
69
- // N11c: Keys<Record<string | "30", 1>>;
70
- } extends Record<string, never> ? "PASS" : never;
71
- }
1
+ declare type Keys<R extends object> = Interface<R> extends never
2
+ ? never
3
+ : keyof Interface<R>;
4
+
5
+ declare namespace Keys {
6
+ const RESULT: {
7
+ positive: typeof POSITIVE | 1;
8
+ negative: typeof NEGATIVE | 0;
9
+ };
10
+
11
+ export const POSITIVE: {
12
+ T: Keys<{ a: 5 }>;
13
+ T0: Keys<{
14
+ a: 1;
15
+ b?: 2;
16
+ }>;
17
+ T1: Keys<{
18
+ a: 1;
19
+ b: 2;
20
+ }>;
21
+ } extends Record<string, string> ? "PASS" : never;
22
+ const s: unique symbol;
23
+
24
+ export const NEGATIVE: {
25
+ N: Keys<never>;
26
+ N0: Keys<{ [s]: 1 }>;
27
+ N1: Keys<Record<string, 1>>;
28
+ N1b: Keys<Record<stringful, 1>>;
29
+ N1c: Keys<Record<"", 1>>;
30
+ N1d: Keys<Record<number, 1>>;
31
+ N2: Keys<Record<stringful | "30", 1>>;
32
+ N2b: Keys<Record<stringful | "", 1>>;
33
+ N2c: Keys<Record<number | "", 1>>;
34
+ N2d: Keys<Record<number | "c", 1>>;
35
+ N2e: Keys<object>;
36
+ N2f: Keys<{
37
+ a: 1;
38
+ [min]: 1;
39
+ }>;
40
+ N3: Keys<[]>;
41
+ N3a: Keys<readonly [1, 1]>;
42
+ N4: Keys<
43
+ | {
44
+ a: 1;
45
+ b: 1;
46
+ }
47
+ | object
48
+ >;
49
+ N5: Keys<[1] | { a: 1 }>;
50
+ N5a: Keys<
51
+ | {
52
+ a: 1;
53
+ b: 1;
54
+ }
55
+ | { c: 1 }
56
+ >;
57
+ N5b: Keys<
58
+ | {
59
+ a: 1;
60
+ b: 1;
61
+ }
62
+ | { c?: 1 }
63
+ >;
64
+
65
+ // N10: Keys<null>;
66
+ // N10a: Keys<undefined>;
67
+ // N10b: Keys<void>;
68
+ // N10c: Keys<unknown>;
69
+ // N11c: Keys<Record<string | "30", 1>>;
70
+ } extends Record<string, never> ? "PASS" : never;
71
+ }
@@ -1,45 +1,45 @@
1
- declare type Unrequire<R extends object, OK extends string> = Interface<R> extends never
2
- ? never
3
- : literalful<OK> extends never
4
- ? never
5
- : OK extends keyof R
6
- ? Omit<Interface<R>, literalful<OK>> & Partial<Pick<Interface<R>, literalful<OK>>>
7
- : never;
8
-
9
- declare namespace Unrequire {
10
- export type T = Unrequire<{
11
- a: 1;
12
- b: 1;
13
- c: 1;
14
- }, "c">;
15
- export type T1c = "a" extends keyof T ? true : false; // true
16
- export type T1b = "b" extends keyof T ? true : false; // true
17
- export type T1 = "c" extends keyof T ? true : false; // true
18
- export type T2 = {
19
- a: 1;
20
- b: 1;
21
- } extends T ? true : false; // true
22
- export type T2b = {
23
- a: 1;
24
- b: 1;
25
- c: 1;
26
- } extends T ? true : false; // true
27
- export type T2c = {
28
- a: 1;
29
- b: 1;
30
- c: 1;
31
- z: 9001;
32
- } extends T ? true : false; // true
33
- }
34
-
35
- declare namespace NotUnrequire {
36
- export type N_null = {
37
- a: 1;
38
- b: 1;
39
- c: 1;
40
- } extends Unrequire.T ? true : false; // true
41
- export type N = {
42
- b: 1;
43
- c: 1;
44
- } extends Unrequire.T ? true : false; // false
45
- }
1
+ declare type Unrequire<R extends object, OK extends string> = Interface<R> extends never
2
+ ? never
3
+ : literalful<OK> extends never
4
+ ? never
5
+ : OK extends keyof R
6
+ ? Omit<Interface<R>, literalful<OK>> & Partial<Pick<Interface<R>, literalful<OK>>>
7
+ : never;
8
+
9
+ declare namespace Unrequire {
10
+ export type T = Unrequire<{
11
+ a: 1;
12
+ b: 1;
13
+ c: 1;
14
+ }, "c">;
15
+ export type T1c = "a" extends keyof T ? true : false; // true
16
+ export type T1b = "b" extends keyof T ? true : false; // true
17
+ export type T1 = "c" extends keyof T ? true : false; // true
18
+ export type T2 = {
19
+ a: 1;
20
+ b: 1;
21
+ } extends T ? true : false; // true
22
+ export type T2b = {
23
+ a: 1;
24
+ b: 1;
25
+ c: 1;
26
+ } extends T ? true : false; // true
27
+ export type T2c = {
28
+ a: 1;
29
+ b: 1;
30
+ c: 1;
31
+ z: 9001;
32
+ } extends T ? true : false; // true
33
+ }
34
+
35
+ declare namespace NotUnrequire {
36
+ export type N_null = {
37
+ a: 1;
38
+ b: 1;
39
+ c: 1;
40
+ } extends Unrequire.T ? true : false; // true
41
+ export type N = {
42
+ b: 1;
43
+ c: 1;
44
+ } extends Unrequire.T ? true : false; // false
45
+ }
@@ -1,12 +1,12 @@
1
- // TODO: constrain to positive integer
2
- declare type ArrayN<I, N extends number = 0> = [I] extends [never]
3
- ? never
4
- : N extends number
5
- ? N extends 0
6
- ? [...I[]]
7
- : ArrayBuilder<I, N>
8
- : never;
9
-
10
- type ArrayBuilder<I, N extends number, H extends I[] = []> = H["length"] extends N
11
- ? [...H, ...I[]]
12
- : ArrayBuilder<I, N, [...H, I]>;
1
+ // TODO: constrain to positive integer
2
+ declare type ArrayN<I, N extends number = 0> = [I] extends [never]
3
+ ? never
4
+ : N extends number
5
+ ? N extends 0
6
+ ? [...I[]]
7
+ : ArrayBuilder<I, N>
8
+ : never;
9
+
10
+ type ArrayBuilder<I, N extends number, H extends I[] = []> = H["length"] extends N
11
+ ? [...H, ...I[]]
12
+ : ArrayBuilder<I, N, [...H, I]>;