@eslinted/core 11.2.0 → 12.0.0-rc.0
Sign up to get free protection for your applications and to get access to all the features.
package/package.json
CHANGED
@@ -1,3 +1,13 @@
|
|
1
|
-
declare type ToNumber<Value extends string> = literalful<Value> extends
|
2
|
-
?
|
3
|
-
:
|
1
|
+
declare type ToNumber<Value extends string> = literalful<Value> extends never
|
2
|
+
? never
|
3
|
+
: literalful<Value> extends literalful<Exclude<literalful<Value>, "0" | "-0" >>
|
4
|
+
? literalful<Value> extends `${infer Number extends number}`
|
5
|
+
? number extends Number
|
6
|
+
? never
|
7
|
+
: Number
|
8
|
+
: never
|
9
|
+
: literalful<Exclude<literalful<Value>, "0" | "-0" >> extends `${infer Number extends number}`
|
10
|
+
? number extends Number
|
11
|
+
? never
|
12
|
+
: 0 | Number
|
13
|
+
: never;
|
@@ -0,0 +1,57 @@
|
|
1
|
+
declare namespace ToNumber {
|
2
|
+
export type OK = Tester<TF> | 0;
|
3
|
+
export type TF = {
|
4
|
+
T: {
|
5
|
+
T0: ToNumber<"0">;
|
6
|
+
T0a: ToNumber<"-0">;
|
7
|
+
T1: ToNumber<"0" | "-0">;
|
8
|
+
T2: ToNumber<"0" | "1">;
|
9
|
+
T2a: ToNumber<"-0" | "1">;
|
10
|
+
T2d: ToNumber<"0" | "-1">;
|
11
|
+
T2e: ToNumber<"-0" | "-1">;
|
12
|
+
T3: ToNumber<"1">;
|
13
|
+
T3a: ToNumber<"-1">;
|
14
|
+
T4: ToNumber<"0.1">;
|
15
|
+
T4b: ToNumber<"-0.1">;
|
16
|
+
T6: ToNumber<"5" | "9">;
|
17
|
+
T6a: ToNumber<"5" | "-9">;
|
18
|
+
T6b: ToNumber<"5" | "0.9">;
|
19
|
+
T6c: ToNumber<"5" | "-0.9">;
|
20
|
+
Tn: ToNumber<`1${1 | 2 | 3 | 4}`>;
|
21
|
+
Tna: ToNumber<`-1${1 | 2 | 3 | 4}`>;
|
22
|
+
Tnb: ToNumber<`1${1 | 2 | 3 | 4}` | `-1${1 | 2 | 3 | 4}`>;
|
23
|
+
Tnc: ToNumber<"-0" | `1${1 | 2 | 3 | 4}` | `-1${1 | 2 | 3 | 4}`>;
|
24
|
+
};
|
25
|
+
F: {
|
26
|
+
F0: ToNumber<string>;
|
27
|
+
F1: ToNumber<"">;
|
28
|
+
F2: ToNumber<"NaN">;
|
29
|
+
F2a: ToNumber<"Infinity">;
|
30
|
+
F2b: ToNumber<"-Infinity">;
|
31
|
+
F3: ToNumber<"0.0">;
|
32
|
+
F3a: ToNumber<"-0.0">;
|
33
|
+
F3d: ToNumber<"1.0">;
|
34
|
+
F3e: ToNumber<"-1.0">;
|
35
|
+
F4: ToNumber<"0.0" | "-0">;
|
36
|
+
F4a: ToNumber<"-0.0" | "-0">;
|
37
|
+
F4b: ToNumber<"-0.0" | "0">;
|
38
|
+
F4c: ToNumber<"0.0" | "-1">;
|
39
|
+
F4d: ToNumber<"-0.0" | "-1">;
|
40
|
+
F4e: ToNumber<"0.0" | "1">;
|
41
|
+
F4f: ToNumber<"-0.0" | "1">;
|
42
|
+
F4g: ToNumber<"0" | "-1.0">;
|
43
|
+
F4h: ToNumber<"-0" | "-1.0">;
|
44
|
+
F4i: ToNumber<"0.0" | "-1.0">;
|
45
|
+
F4j: ToNumber<"-0.0" | "-1.0">;
|
46
|
+
F5: ToNumber<".1">;
|
47
|
+
F5a: ToNumber<"-.1">;
|
48
|
+
F6: ToNumber<"" | "0">;
|
49
|
+
F6a: ToNumber<"" | "1">;
|
50
|
+
F6b: ToNumber<"1" | ".9">;
|
51
|
+
F6c: ToNumber<"5" | ".9">;
|
52
|
+
F6d: ToNumber<"5" | "-.9">;
|
53
|
+
Fn: ToNumber<`1${number}`>;
|
54
|
+
Fna: ToNumber<`-1${number}`>;
|
55
|
+
};
|
56
|
+
};
|
57
|
+
}
|