arktype 0.3.0 → 0.5.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/dist/api.cjs +9 -0
- package/dist/api.d.ts +10 -0
- package/dist/api.mjs +1 -0
- package/dist/cjs/nodes/branch.js +15 -6
- package/dist/cjs/nodes/compose.js +1 -1
- package/dist/cjs/nodes/discriminate.js +89 -21
- package/dist/cjs/nodes/node.js +11 -11
- package/dist/cjs/nodes/predicate.js +1 -1
- package/dist/cjs/nodes/rules/class.js +2 -2
- package/dist/cjs/nodes/rules/divisor.js +1 -1
- package/dist/cjs/nodes/rules/props.js +1 -2
- package/dist/cjs/nodes/rules/range.js +2 -2
- package/dist/cjs/nodes/rules/regex.js +1 -1
- package/dist/cjs/nodes/rules/rules.js +4 -0
- package/dist/cjs/parse/ast/ast.js +4 -0
- package/dist/cjs/parse/ast/bound.js +9 -0
- package/dist/cjs/parse/{tuple/utils.js → ast/distributableFunction.js} +1 -1
- package/dist/cjs/parse/ast/divisor.js +9 -0
- package/dist/cjs/parse/{string/ast.js → ast/intersection.js} +2 -8
- package/dist/cjs/parse/ast/keyof.js +109 -0
- package/dist/cjs/parse/{tuple → ast}/morph.js +1 -1
- package/dist/cjs/parse/{tuple → ast}/narrow.js +2 -2
- package/dist/cjs/parse/{tuple → ast}/tuple.js +11 -10
- package/dist/cjs/parse/ast/union.js +9 -0
- package/dist/cjs/parse/ast/utils.js +4 -0
- package/dist/cjs/parse/definition.js +12 -2
- package/dist/cjs/parse/string/reduce/dynamic.js +7 -7
- package/dist/cjs/parse/string/shift/operator/bounds.js +4 -4
- package/dist/cjs/parse/string/shift/operator/divisor.js +3 -3
- package/dist/cjs/parse/string/string.js +1 -1
- package/dist/cjs/scopes/expressions.js +29 -0
- package/dist/cjs/scopes/scope.js +59 -6
- package/dist/cjs/scopes/validation.js +16 -1
- package/dist/cjs/traverse/problems.js +78 -46
- package/dist/cjs/traverse/traverse.js +62 -58
- package/dist/cjs/utils/data.js +39 -0
- package/dist/cjs/utils/freeze.js +2 -3
- package/dist/cjs/utils/generics.js +20 -2
- package/dist/cjs/utils/numericLiterals.js +2 -14
- package/dist/mjs/nodes/branch.js +14 -5
- package/dist/mjs/nodes/compose.js +2 -2
- package/dist/mjs/nodes/discriminate.js +89 -21
- package/dist/mjs/nodes/node.js +8 -8
- package/dist/mjs/nodes/predicate.js +2 -2
- package/dist/mjs/nodes/rules/class.js +2 -2
- package/dist/mjs/nodes/rules/divisor.js +1 -1
- package/dist/mjs/nodes/rules/props.js +1 -2
- package/dist/mjs/nodes/rules/range.js +2 -2
- package/dist/mjs/nodes/rules/regex.js +1 -1
- package/dist/mjs/nodes/rules/rules.js +4 -0
- package/dist/mjs/parse/ast/ast.js +1 -0
- package/dist/mjs/parse/ast/bound.js +1 -0
- package/dist/mjs/parse/{tuple/utils.js → ast/distributableFunction.js} +2 -2
- package/dist/mjs/parse/ast/divisor.js +1 -0
- package/dist/mjs/parse/{string/ast.js → ast/intersection.js} +2 -5
- package/dist/mjs/parse/ast/keyof.js +101 -0
- package/dist/mjs/parse/{tuple → ast}/morph.js +1 -1
- package/dist/mjs/parse/ast/narrow.js +7 -0
- package/dist/mjs/parse/{tuple → ast}/tuple.js +12 -11
- package/dist/mjs/parse/ast/union.js +1 -0
- package/dist/mjs/parse/ast/utils.js +1 -0
- package/dist/mjs/parse/definition.js +12 -2
- package/dist/mjs/parse/string/reduce/dynamic.js +8 -8
- package/dist/mjs/parse/string/shift/operator/bounds.js +4 -4
- package/dist/mjs/parse/string/shift/operator/divisor.js +3 -3
- package/dist/mjs/parse/string/string.js +2 -2
- package/dist/mjs/scopes/expressions.js +9 -0
- package/dist/mjs/scopes/scope.js +58 -5
- package/dist/mjs/scopes/validation.js +16 -1
- package/dist/mjs/traverse/problems.js +76 -44
- package/dist/mjs/traverse/traverse.js +37 -34
- package/dist/mjs/utils/data.js +24 -0
- package/dist/mjs/utils/freeze.js +2 -3
- package/dist/mjs/utils/generics.js +18 -1
- package/dist/mjs/utils/numericLiterals.js +1 -1
- package/dist/tsconfig.temp.tsbuildinfo +1 -1
- package/dist/types/nodes/branch.d.ts +3 -12
- package/dist/types/nodes/discriminate.d.ts +6 -8
- package/dist/types/nodes/infer.d.ts +5 -5
- package/dist/types/nodes/node.d.ts +4 -13
- package/dist/types/nodes/predicate.d.ts +2 -29
- package/dist/types/nodes/rules/range.d.ts +2 -2
- package/dist/types/nodes/rules/rules.d.ts +1 -1
- package/dist/types/parse/ast/ast.d.ts +24 -0
- package/dist/types/parse/ast/bound.d.ts +10 -0
- package/dist/types/parse/{tuple/utils.d.ts → ast/distributableFunction.d.ts} +2 -3
- package/dist/types/parse/ast/divisor.d.ts +8 -0
- package/dist/types/parse/ast/intersection.d.ts +17 -0
- package/dist/types/parse/{tuple → ast}/keyof.d.ts +4 -4
- package/dist/types/parse/ast/morph.d.ts +18 -0
- package/dist/types/parse/ast/narrow.d.ts +21 -0
- package/dist/types/parse/ast/tuple.d.ts +40 -0
- package/dist/types/parse/ast/union.d.ts +12 -0
- package/dist/types/parse/ast/utils.d.ts +7 -0
- package/dist/types/parse/definition.d.ts +9 -7
- package/dist/types/parse/record.d.ts +2 -2
- package/dist/types/parse/string/reduce/shared.d.ts +5 -4
- package/dist/types/parse/string/reduce/static.d.ts +11 -6
- package/dist/types/parse/string/shift/operand/unenclosed.d.ts +1 -1
- package/dist/types/parse/string/shift/operator/bounds.d.ts +3 -2
- package/dist/types/parse/string/shift/operator/divisor.d.ts +5 -1
- package/dist/types/parse/string/shift/scanner.d.ts +1 -1
- package/dist/types/parse/string/string.d.ts +1 -2
- package/dist/types/scopes/expressions.d.ts +48 -0
- package/dist/types/scopes/scope.d.ts +17 -7
- package/dist/types/scopes/standard.d.ts +15 -0
- package/dist/types/scopes/type.d.ts +9 -5
- package/dist/types/scopes/validation.d.ts +4 -0
- package/dist/types/traverse/problems.d.ts +17 -24
- package/dist/types/traverse/traverse.d.ts +67 -37
- package/dist/types/utils/data.d.ts +13 -0
- package/dist/types/utils/domains.d.ts +1 -1
- package/dist/types/utils/generics.d.ts +14 -10
- package/dist/types/utils/numericLiterals.d.ts +16 -0
- package/dist/types/utils/paths.d.ts +2 -0
- package/package.json +1 -1
- package/dist/cjs/parse/tuple/keyof.js +0 -64
- package/dist/cjs/utils/size.js +0 -16
- package/dist/mjs/parse/tuple/keyof.js +0 -56
- package/dist/mjs/parse/tuple/narrow.js +0 -7
- package/dist/mjs/utils/size.js +0 -2
- package/dist/types/parse/string/ast.d.ts +0 -46
- package/dist/types/parse/tuple/morph.d.ts +0 -15
- package/dist/types/parse/tuple/narrow.d.ts +0 -13
- package/dist/types/parse/tuple/tuple.d.ts +0 -31
- package/dist/types/utils/size.d.ts +0 -3
|
@@ -1,51 +1,81 @@
|
|
|
1
1
|
import type { TraversalEntry, TraversalKey, TraversalNode, TraversalValue } from "../nodes/node.js";
|
|
2
2
|
import type { TraversalProp } from "../nodes/rules/props.js";
|
|
3
3
|
import type { Type, TypeConfig } from "../scopes/type.js";
|
|
4
|
+
import type { SizedData } from "../utils/data.js";
|
|
4
5
|
import type { extend, stringKeyOf } from "../utils/generics.js";
|
|
5
6
|
import { Path } from "../utils/paths.js";
|
|
6
|
-
import type { SizedData } from "../utils/size.js";
|
|
7
7
|
import type { ProblemCode, ProblemWriters } from "./problems.js";
|
|
8
|
+
import { Problem } from "./problems.js";
|
|
8
9
|
export declare class TraversalState<data = unknown> {
|
|
9
10
|
#private;
|
|
10
11
|
data: data;
|
|
11
12
|
type: Type;
|
|
12
13
|
path: Path;
|
|
13
|
-
problems:
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
14
|
+
problems: import("../utils/generics.js").arraySubclassToReadonly<{
|
|
15
|
+
[n: number]: Problem<any>;
|
|
16
|
+
byPath: Record<string, Problem<any>>;
|
|
17
|
+
count: number;
|
|
18
|
+
"__#2@#state": TraversalState<unknown>;
|
|
19
|
+
add<code extends ProblemCode>(code: code, source: import("./problems.js").ProblemSource<code>, opts?: import("./problems.js").AddProblemOptions<import("./problems.js").ProblemData<code>> | undefined): Problem<any>;
|
|
20
|
+
addProblem(problem: Problem<any>): void;
|
|
21
|
+
readonly summary: string;
|
|
22
|
+
toString(): string;
|
|
23
|
+
throw(): never;
|
|
24
|
+
length: number;
|
|
25
|
+
toLocaleString(): string;
|
|
26
|
+
pop(): Problem<any> | undefined;
|
|
27
|
+
push(...items: Problem<any>[]): number;
|
|
28
|
+
concat(...items: ConcatArray<Problem<any>>[]): Problem<any>[];
|
|
29
|
+
concat(...items: (Problem<any> | ConcatArray<Problem<any>>)[]): Problem<any>[];
|
|
30
|
+
join(separator?: string | undefined): string;
|
|
31
|
+
reverse(): Problem<any>[];
|
|
32
|
+
shift(): Problem<any> | undefined;
|
|
33
|
+
slice(start?: number | undefined, end?: number | undefined): Problem<any>[];
|
|
34
|
+
sort(compareFn?: ((a: Problem<any>, b: Problem<any>) => number) | undefined): any;
|
|
35
|
+
splice(start: number, deleteCount?: number | undefined): Problem<any>[];
|
|
36
|
+
splice(start: number, deleteCount: number, ...items: Problem<any>[]): Problem<any>[];
|
|
37
|
+
unshift(...items: Problem<any>[]): number;
|
|
38
|
+
indexOf(searchElement: Problem<any>, fromIndex?: number | undefined): number;
|
|
39
|
+
lastIndexOf(searchElement: Problem<any>, fromIndex?: number | undefined): number;
|
|
40
|
+
every<S extends Problem<any>>(predicate: (value: Problem<any>, index: number, array: Problem<any>[]) => value is S, thisArg?: any): this is S[];
|
|
41
|
+
every(predicate: (value: Problem<any>, index: number, array: Problem<any>[]) => unknown, thisArg?: any): boolean;
|
|
42
|
+
some(predicate: (value: Problem<any>, index: number, array: Problem<any>[]) => unknown, thisArg?: any): boolean;
|
|
43
|
+
forEach(callbackfn: (value: Problem<any>, index: number, array: Problem<any>[]) => void, thisArg?: any): void;
|
|
44
|
+
map<U>(callbackfn: (value: Problem<any>, index: number, array: Problem<any>[]) => U, thisArg?: any): U[];
|
|
45
|
+
filter<S_1 extends Problem<any>>(predicate: (value: Problem<any>, index: number, array: Problem<any>[]) => value is S_1, thisArg?: any): S_1[];
|
|
46
|
+
filter(predicate: (value: Problem<any>, index: number, array: Problem<any>[]) => unknown, thisArg?: any): Problem<any>[];
|
|
47
|
+
reduce(callbackfn: (previousValue: Problem<any>, currentValue: Problem<any>, currentIndex: number, array: Problem<any>[]) => Problem<any>): Problem<any>;
|
|
48
|
+
reduce(callbackfn: (previousValue: Problem<any>, currentValue: Problem<any>, currentIndex: number, array: Problem<any>[]) => Problem<any>, initialValue: Problem<any>): Problem<any>;
|
|
49
|
+
reduce<U_1>(callbackfn: (previousValue: U_1, currentValue: Problem<any>, currentIndex: number, array: Problem<any>[]) => U_1, initialValue: U_1): U_1;
|
|
50
|
+
reduceRight(callbackfn: (previousValue: Problem<any>, currentValue: Problem<any>, currentIndex: number, array: Problem<any>[]) => Problem<any>): Problem<any>;
|
|
51
|
+
reduceRight(callbackfn: (previousValue: Problem<any>, currentValue: Problem<any>, currentIndex: number, array: Problem<any>[]) => Problem<any>, initialValue: Problem<any>): Problem<any>;
|
|
52
|
+
reduceRight<U_2>(callbackfn: (previousValue: U_2, currentValue: Problem<any>, currentIndex: number, array: Problem<any>[]) => U_2, initialValue: U_2): U_2;
|
|
53
|
+
find<S_2 extends Problem<any>>(predicate: (value: Problem<any>, index: number, obj: Problem<any>[]) => value is S_2, thisArg?: any): S_2 | undefined;
|
|
54
|
+
find(predicate: (value: Problem<any>, index: number, obj: Problem<any>[]) => unknown, thisArg?: any): Problem<any> | undefined;
|
|
55
|
+
findIndex(predicate: (value: Problem<any>, index: number, obj: Problem<any>[]) => unknown, thisArg?: any): number;
|
|
56
|
+
fill(value: Problem<any>, start?: number | undefined, end?: number | undefined): any;
|
|
57
|
+
copyWithin(target: number, start: number, end?: number | undefined): any;
|
|
58
|
+
entries(): IterableIterator<[number, Problem<any>]>;
|
|
59
|
+
keys(): IterableIterator<number>;
|
|
60
|
+
values(): IterableIterator<Problem<any>>;
|
|
61
|
+
includes(searchElement: Problem<any>, fromIndex?: number | undefined): boolean;
|
|
62
|
+
flatMap<U_3, This = undefined>(callback: (this: This, value: Problem<any>, index: number, array: Problem<any>[]) => U_3 | readonly U_3[], thisArg?: This | undefined): U_3[];
|
|
63
|
+
flat<A, D extends number = 1>(this: A, depth?: D | undefined): FlatArray<A, D>[];
|
|
64
|
+
at(index: number): Problem<any> | undefined;
|
|
65
|
+
findLast<S_3 extends Problem<any>>(predicate: (value: Problem<any>, index: number, array: Problem<any>[]) => value is S_3, thisArg?: any): S_3 | undefined;
|
|
66
|
+
findLast(predicate: (value: Problem<any>, index: number, array: Problem<any>[]) => unknown, thisArg?: any): Problem<any> | undefined;
|
|
67
|
+
findLastIndex(predicate: (value: Problem<any>, index: number, array: Problem<any>[]) => unknown, thisArg?: any): number;
|
|
68
|
+
[Symbol.iterator](): IterableIterator<Problem<any>>;
|
|
69
|
+
[Symbol.unscopables](): {
|
|
70
|
+
copyWithin: boolean;
|
|
71
|
+
entries: boolean;
|
|
72
|
+
fill: boolean;
|
|
73
|
+
find: boolean;
|
|
74
|
+
findIndex: boolean;
|
|
75
|
+
keys: boolean;
|
|
76
|
+
values: boolean;
|
|
77
|
+
};
|
|
78
|
+
}>;
|
|
49
79
|
configs: TypeConfig[];
|
|
50
80
|
failFast: boolean;
|
|
51
81
|
constructor(data: data, type: Type);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { domainOf } from "./domains.js";
|
|
2
|
+
export type SizedData = string | number | readonly unknown[];
|
|
3
|
+
export declare const sizeOf: (data: unknown) => number;
|
|
4
|
+
export declare const unitsOf: (data: unknown) => "" | "characters" | "items";
|
|
5
|
+
export declare class DataWrapper<value = unknown> {
|
|
6
|
+
value: value;
|
|
7
|
+
constructor(value: value);
|
|
8
|
+
toString(): string;
|
|
9
|
+
get domain(): domainOf<value>;
|
|
10
|
+
get size(): number;
|
|
11
|
+
get units(): "" | "characters" | "items";
|
|
12
|
+
get className(): any;
|
|
13
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { evaluate, isTopType } from "./generics.js";
|
|
2
|
-
export declare const hasDomain: <data, domain extends
|
|
2
|
+
export declare const hasDomain: <data, domain extends Domain>(data: data, domain: domain) => data is data & inferDomain<domain>;
|
|
3
3
|
type DomainTypes = {
|
|
4
4
|
bigint: bigint;
|
|
5
5
|
boolean: boolean;
|
|
@@ -5,19 +5,19 @@ type asConstRecurse<t> = {
|
|
|
5
5
|
};
|
|
6
6
|
export type castWithExclusion<t, castTo, excluded> = t extends excluded ? t : castTo;
|
|
7
7
|
export type Literalable = string | boolean | number | bigint;
|
|
8
|
-
export type
|
|
9
|
-
export type
|
|
8
|
+
export type evaluateObjectOrFunction<t> = isTopType<t> extends true ? t : t extends (...args: infer args) => infer ret ? (...args: args) => ret : evaluate<t>;
|
|
9
|
+
export type evaluate<t> = {
|
|
10
10
|
[k in keyof t]: t[k];
|
|
11
11
|
} & unknown;
|
|
12
12
|
/** Causes a type that would be eagerly calculated to be displayed as-is.
|
|
13
13
|
* WARNING: Makes t NonNullable as a side effect.
|
|
14
14
|
*/
|
|
15
15
|
export type defer<t> = t & {};
|
|
16
|
-
export type merge<base, merged> =
|
|
16
|
+
export type merge<base, merged> = evaluate<Omit<base, keyof merged> & merged>;
|
|
17
17
|
/** Replace existing keys of o without altering readonly or optional modifiers */
|
|
18
18
|
export type replaceProps<o, replacements extends {
|
|
19
19
|
-readonly [k in keyof o]?: unknown;
|
|
20
|
-
}> =
|
|
20
|
+
}> = evaluate<{
|
|
21
21
|
[k in keyof o]: k extends keyof replacements ? replacements[k] : o[k];
|
|
22
22
|
}>;
|
|
23
23
|
export type isTopType<t> = (any extends t ? true : false) extends true ? true : false;
|
|
@@ -39,11 +39,12 @@ export type entryOf<o> = {
|
|
|
39
39
|
export type entriesOf<o extends object> = entryOf<o>[];
|
|
40
40
|
export declare const entriesOf: <o extends object>(o: o) => entriesOf<o>;
|
|
41
41
|
/** Mimics the result of Object.keys(...) */
|
|
42
|
-
export type
|
|
43
|
-
export
|
|
44
|
-
export declare const keysOf: <o extends object>(o: o) => keyOf<o>[];
|
|
42
|
+
export type objectKeysOf<o> = [o] extends [object] ? o extends readonly unknown[] ? any[] extends o ? `${number}` : keyof o & `${number}` : keyof o extends number ? `${keyof o}` : Exclude<keyof o, symbol> : never;
|
|
43
|
+
export declare const objectKeysOf: <o extends object>(o: o) => objectKeysOf<o>[];
|
|
45
44
|
export type stringKeyOf<o> = keyof o & string;
|
|
46
|
-
|
|
45
|
+
/** Mimics output of TS's keyof operator at runtime */
|
|
46
|
+
export declare const prototypeKeysOf: <t>(value: t) => (keyof t)[];
|
|
47
|
+
export declare const hasKey: <o, k extends string>(o: o, k: k) => o is Extract<o, { [_ in k]: {}; }>;
|
|
47
48
|
export declare const keyCount: (o: object) => number;
|
|
48
49
|
export type keySet<key extends string = string> = {
|
|
49
50
|
readonly [_ in key]?: true;
|
|
@@ -101,6 +102,9 @@ export type Dict<k extends string = string, v = unknown> = {
|
|
|
101
102
|
readonly [_ in k]: v;
|
|
102
103
|
};
|
|
103
104
|
export type List<t = unknown> = readonly t[];
|
|
105
|
+
export type arraySubclassToReadonly<t extends unknown[]> = readonly t[number][] & {
|
|
106
|
+
[k in Exclude<keyof t, keyof unknown[]>]: t[k];
|
|
107
|
+
};
|
|
104
108
|
export type HomogenousTuple<item, length extends number, result extends item[] = []> = result["length"] extends length ? result : HomogenousTuple<item, length, [...result, item]>;
|
|
105
109
|
export declare const listFrom: <t>(data: t) => t extends List<unknown> ? t : readonly t[];
|
|
106
110
|
export type CollapsibleList<t> = t | readonly t[];
|
|
@@ -109,9 +113,9 @@ export type CollapsibleList<t> = t | readonly t[];
|
|
|
109
113
|
* OR
|
|
110
114
|
* B, with all properties of A undefined
|
|
111
115
|
**/
|
|
112
|
-
export type xor<a, b> =
|
|
116
|
+
export type xor<a, b> = evaluate<a & {
|
|
113
117
|
[k in keyof b]?: undefined;
|
|
114
|
-
}> |
|
|
118
|
+
}> | evaluate<b & {
|
|
115
119
|
[k in keyof a]?: undefined;
|
|
116
120
|
}>;
|
|
117
121
|
export {};
|
|
@@ -1,6 +1,22 @@
|
|
|
1
1
|
export type BigintLiteral<Value extends bigint = bigint> = `${Value}n`;
|
|
2
2
|
export type NumberLiteral<Value extends number = number> = `${Value}`;
|
|
3
3
|
export type IntegerLiteral<Value extends bigint = bigint> = `${Value}`;
|
|
4
|
+
/**
|
|
5
|
+
* The goal of the number literal and bigint literal regular expressions is to:
|
|
6
|
+
*
|
|
7
|
+
* 1. Ensure definitions form a bijection with the values they represent.
|
|
8
|
+
* 2. Attempt to mirror TypeScript's own format for stringification of numeric
|
|
9
|
+
* values such that the regex should match a given definition if any only if
|
|
10
|
+
* a precise literal type will be inferred (in TS4.8+).
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Matches a well-formatted numeric expression according to the following rules:
|
|
14
|
+
* 1. Must include an integer portion (i.e. '.321' must be written as '0.321')
|
|
15
|
+
* 2. The first digit of the value must not be 0, unless the entire integer portion is 0
|
|
16
|
+
* 3. If the value includes a decimal, its last digit may not be 0
|
|
17
|
+
* 4. The value may not be "-0"
|
|
18
|
+
*/
|
|
19
|
+
export declare const wellFormedNumberMatcher: RegExp;
|
|
4
20
|
/**
|
|
5
21
|
* Matches a well-formatted integer according to the following rules:
|
|
6
22
|
* 1. Must begin with an integer, the first digit of which cannot be 0 unless the entire value is 0
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import type { arraySubclassToReadonly } from "./generics";
|
|
1
2
|
export declare class Path extends Array<string> {
|
|
2
3
|
static fromString(s: string, delimiter?: string): Path;
|
|
3
4
|
toString(delimiter?: string): string;
|
|
4
5
|
}
|
|
6
|
+
export type ReadonlyPath = arraySubclassToReadonly<Path>;
|
|
5
7
|
export type pathToString<segments extends string[], delimiter extends string = "/"> = segments extends [] ? "/" : join<segments, delimiter>;
|
|
6
8
|
export type join<segments extends string[], delimiter extends string = "/", result extends string = ""> = segments extends [infer head extends string, ...infer tail extends string[]] ? join<tail, delimiter, result extends "" ? head : `${result}${delimiter}${head}`> : result;
|
|
7
9
|
export declare const getPath: (root: unknown, path: string[]) => unknown;
|
package/package.json
CHANGED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
Object.defineProperty(exports, "parseKeyOfTuple", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: ()=>parseKeyOfTuple
|
|
8
|
-
});
|
|
9
|
-
const _predicateTs = require("../../nodes/predicate.js");
|
|
10
|
-
const _propsTs = require("../../nodes/rules/props.js");
|
|
11
|
-
const _errorsTs = require("../../utils/errors.js");
|
|
12
|
-
const _genericsTs = require("../../utils/generics.js");
|
|
13
|
-
const _numericLiteralsTs = require("../../utils/numericLiterals.js");
|
|
14
|
-
const _definitionTs = require("../definition.js");
|
|
15
|
-
const _astTs = require("../string/ast.js");
|
|
16
|
-
const numericIndexKey = {
|
|
17
|
-
regex: _numericLiteralsTs.wellFormedNonNegativeIntegerMatcher.source
|
|
18
|
-
};
|
|
19
|
-
const parseKeyOfTuple = (def, ctx)=>{
|
|
20
|
-
const resolution = ctx.type.meta.scope.resolveNode((0, _definitionTs.parseDefinition)(def[1], ctx));
|
|
21
|
-
if (!(0, _predicateTs.resolutionExtendsDomain)(resolution, "object")) {
|
|
22
|
-
return (0, _errorsTs.throwParseError)((0, _astTs.writeImplicitNeverMessage)(ctx.path, "keyof"));
|
|
23
|
-
}
|
|
24
|
-
if (resolution.object === true) {
|
|
25
|
-
return (0, _astTs.writeImplicitNeverMessage)(ctx.path, "keyof");
|
|
26
|
-
}
|
|
27
|
-
const objectBranches = (0, _genericsTs.listFrom)(resolution.object);
|
|
28
|
-
let sharedKeys = keysOfBranch(objectBranches[0]);
|
|
29
|
-
for(let i = 1; i < objectBranches.length; i++){
|
|
30
|
-
const branchKeys = keysOfBranch(objectBranches[i]);
|
|
31
|
-
// we can filter directly by equality here because the RegExp we're
|
|
32
|
-
// using will always be reference equal to
|
|
33
|
-
// wellFormedNonNegativeIntegerMatcher
|
|
34
|
-
sharedKeys = sharedKeys.filter((k)=>branchKeys.includes(k));
|
|
35
|
-
}
|
|
36
|
-
const result = sharedKeys.map((k)=>typeof k === "string" ? {
|
|
37
|
-
value: k
|
|
38
|
-
} : {
|
|
39
|
-
regex: k.source
|
|
40
|
-
});
|
|
41
|
-
return result.length ? {
|
|
42
|
-
string: result.length === 1 ? result[0] : result
|
|
43
|
-
} : (0, _astTs.writeImplicitNeverMessage)(ctx.path, "keyof");
|
|
44
|
-
};
|
|
45
|
-
const keysOfBranch = (branch)=>{
|
|
46
|
-
if (!("props" in branch)) {
|
|
47
|
-
return [];
|
|
48
|
-
}
|
|
49
|
-
if (branch.class !== "Array") {
|
|
50
|
-
return Object.keys(branch.props);
|
|
51
|
-
}
|
|
52
|
-
const arrayProps = [];
|
|
53
|
-
for (const key of Object.keys(branch.props)){
|
|
54
|
-
if (key === "length") {
|
|
55
|
-
continue;
|
|
56
|
-
}
|
|
57
|
-
if (key === _propsTs.mappedKeys.index) {
|
|
58
|
-
arrayProps.push(_numericLiteralsTs.wellFormedNonNegativeIntegerMatcher);
|
|
59
|
-
} else {
|
|
60
|
-
arrayProps.push(key);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
return arrayProps;
|
|
64
|
-
};
|
package/dist/cjs/utils/size.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
function _export(target, all) {
|
|
6
|
-
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: all[name]
|
|
9
|
-
});
|
|
10
|
-
}
|
|
11
|
-
_export(exports, {
|
|
12
|
-
sizeOf: ()=>sizeOf,
|
|
13
|
-
unitsOf: ()=>unitsOf
|
|
14
|
-
});
|
|
15
|
-
const sizeOf = (data)=>typeof data === "string" || Array.isArray(data) ? data.length : typeof data === "number" ? data : 0;
|
|
16
|
-
const unitsOf = (data)=>typeof data === "string" ? "characters" : Array.isArray(data) ? "items" : "";
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { resolutionExtendsDomain } from "../../nodes/predicate.js";
|
|
2
|
-
import { mappedKeys } from "../../nodes/rules/props.js";
|
|
3
|
-
import { throwParseError } from "../../utils/errors.js";
|
|
4
|
-
import { listFrom } from "../../utils/generics.js";
|
|
5
|
-
import { wellFormedNonNegativeIntegerMatcher } from "../../utils/numericLiterals.js";
|
|
6
|
-
import { parseDefinition } from "../definition.js";
|
|
7
|
-
import { writeImplicitNeverMessage } from "../string/ast.js";
|
|
8
|
-
const numericIndexKey = {
|
|
9
|
-
regex: wellFormedNonNegativeIntegerMatcher.source
|
|
10
|
-
};
|
|
11
|
-
export const parseKeyOfTuple = (def, ctx)=>{
|
|
12
|
-
const resolution = ctx.type.meta.scope.resolveNode(parseDefinition(def[1], ctx));
|
|
13
|
-
if (!resolutionExtendsDomain(resolution, "object")) {
|
|
14
|
-
return throwParseError(writeImplicitNeverMessage(ctx.path, "keyof"));
|
|
15
|
-
}
|
|
16
|
-
if (resolution.object === true) {
|
|
17
|
-
return writeImplicitNeverMessage(ctx.path, "keyof");
|
|
18
|
-
}
|
|
19
|
-
const objectBranches = listFrom(resolution.object);
|
|
20
|
-
let sharedKeys = keysOfBranch(objectBranches[0]);
|
|
21
|
-
for(let i = 1; i < objectBranches.length; i++){
|
|
22
|
-
const branchKeys = keysOfBranch(objectBranches[i]);
|
|
23
|
-
// we can filter directly by equality here because the RegExp we're
|
|
24
|
-
// using will always be reference equal to
|
|
25
|
-
// wellFormedNonNegativeIntegerMatcher
|
|
26
|
-
sharedKeys = sharedKeys.filter((k)=>branchKeys.includes(k));
|
|
27
|
-
}
|
|
28
|
-
const result = sharedKeys.map((k)=>typeof k === "string" ? {
|
|
29
|
-
value: k
|
|
30
|
-
} : {
|
|
31
|
-
regex: k.source
|
|
32
|
-
});
|
|
33
|
-
return result.length ? {
|
|
34
|
-
string: result.length === 1 ? result[0] : result
|
|
35
|
-
} : writeImplicitNeverMessage(ctx.path, "keyof");
|
|
36
|
-
};
|
|
37
|
-
const keysOfBranch = (branch)=>{
|
|
38
|
-
if (!("props" in branch)) {
|
|
39
|
-
return [];
|
|
40
|
-
}
|
|
41
|
-
if (branch.class !== "Array") {
|
|
42
|
-
return Object.keys(branch.props);
|
|
43
|
-
}
|
|
44
|
-
const arrayProps = [];
|
|
45
|
-
for (const key of Object.keys(branch.props)){
|
|
46
|
-
if (key === "length") {
|
|
47
|
-
continue;
|
|
48
|
-
}
|
|
49
|
-
if (key === mappedKeys.index) {
|
|
50
|
-
arrayProps.push(wellFormedNonNegativeIntegerMatcher);
|
|
51
|
-
} else {
|
|
52
|
-
arrayProps.push(key);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
return arrayProps;
|
|
56
|
-
};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { intersection } from "../../nodes/node.js";
|
|
2
|
-
import { parseDefinition } from "../definition.js";
|
|
3
|
-
import { distributeFunctionToNode } from "./utils.js";
|
|
4
|
-
export const parseNarrowTuple = (def, ctx)=>{
|
|
5
|
-
const inputNode = parseDefinition(def[0], ctx);
|
|
6
|
-
return intersection(inputNode, distributeFunctionToNode(def[2], inputNode, ctx, "narrow"), ctx.type);
|
|
7
|
-
};
|
package/dist/mjs/utils/size.js
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import type { DisjointsByPath } from "../../nodes/compose.js";
|
|
2
|
-
import type { MappedKeys } from "../../nodes/rules/props.js";
|
|
3
|
-
import type { resolve } from "../../scopes/scope.js";
|
|
4
|
-
import type { asIn } from "../../scopes/type.js";
|
|
5
|
-
import type { domainOf } from "../../utils/domains.js";
|
|
6
|
-
import type { asConst, castOnError, Dict, equals, error, evaluate, evaluateObject, extractValues, isAny, List, Literalable, RegexLiteral, requiredKeyOf, stringKeyOf, tryCatch } from "../../utils/generics.js";
|
|
7
|
-
import type { objectKindOf } from "../../utils/objectKinds.js";
|
|
8
|
-
import type { Path, pathToString } from "../../utils/paths.js";
|
|
9
|
-
import type { SizedData } from "../../utils/size.js";
|
|
10
|
-
import type { Out, ParsedMorph } from "../tuple/morph.js";
|
|
11
|
-
import type { StringLiteral } from "./shift/operand/enclosed.js";
|
|
12
|
-
import type { Scanner } from "./shift/scanner.js";
|
|
13
|
-
export type inferAst<ast, $> = ast extends List ? ast[1] extends "[]" ? inferAst<ast[0], $>[] : ast[1] extends "|" ? inferUnion<inferAst<ast[0], $>, inferAst<ast[2], $>> extends infer result ? castOnError<result, never> : never : ast[1] extends "&" ? inferIntersection<inferAst<ast[0], $>, inferAst<ast[2], $>> extends infer result ? castOnError<result, never> : never : ast[1] extends Scanner.Comparator ? ast[0] extends number ? inferAst<ast[2], $> : inferAst<ast[0], $> : ast[1] extends "%" ? inferAst<ast[0], $> : never : inferTerminal<ast, $>;
|
|
14
|
-
export type validateAstSemantics<ast, $> = ast extends string ? undefined : ast extends [infer child, unknown] ? validateAstSemantics<child, $> : ast extends [infer l, infer token, infer r] ? token extends "&" ? tryCatch<inferIntersection<inferAst<l, $>, inferAst<r, $>>, validateBinary<l, r, $>> : token extends "|" ? tryCatch<inferUnion<inferAst<l, $>, inferAst<r, $>>, validateBinary<l, r, $>> : token extends Scanner.Comparator ? l extends number ? validateAstSemantics<r, $> : isBoundable<inferAst<l, $>> extends true ? validateAstSemantics<l, $> : error<writeUnboundableMessage<astToString<ast[0]>>> : token extends "%" ? isDivisible<inferAst<l, $>> extends true ? validateAstSemantics<l, $> : error<writeIndivisibleMessage<astToString<ast[0]>>> : validateAstSemantics<l, $> : undefined;
|
|
15
|
-
type validateBinary<l, r, $> = tryCatch<validateAstSemantics<l, $>, tryCatch<validateAstSemantics<r, $>, undefined>>;
|
|
16
|
-
export type inferIntersection<l, r> = inferIntersectionRecurse<l, r, []>;
|
|
17
|
-
type inferIntersectionRecurse<l, r, path extends string[]> = path["length"] extends 10 ? l & r : l extends never ? never : r extends never ? never : l & r extends never ? error<writeImplicitNeverMessage<path, "Intersection">> : isAny<l | r> extends true ? any : l extends ParsedMorph<infer lIn, infer lOut> ? r extends ParsedMorph ? error<writeImplicitNeverMessage<path, "Intersection", "of morphs">> : (In: evaluate<lIn & r>) => Out<lOut> : r extends ParsedMorph<infer rIn, infer rOut> ? (In: evaluate<rIn & l>) => Out<rOut> : [l, r] extends [Dict, Dict] ? bubblePropErrors<evaluateObject<{
|
|
18
|
-
[k in stringKeyOf<l>]: k extends keyof r ? inferIntersectionRecurse<l[k], r[k], [...path, k]> : l[k];
|
|
19
|
-
} & Omit<r, keyof l>>> : [l, r] extends [List<infer lItem>, List<infer rItem>] ? inferIntersectionRecurse<lItem, rItem, [
|
|
20
|
-
...path,
|
|
21
|
-
MappedKeys["index"]
|
|
22
|
-
]> extends infer result ? tryCatch<result, result[]> : never : l & r;
|
|
23
|
-
type bubblePropErrors<o> = extractValues<o, error> extends never ? o : extractValues<o, error>;
|
|
24
|
-
export type inferUnion<l, r> = isAny<l | r> extends true ? any : [l] extends [never] ? r : [r] extends [never] ? l : [asIn<l>, asIn<r>] extends [infer lIn, infer rIn] ? [equals<l, lIn>, equals<r, rIn>] extends [true, true] ? l | r : discriminatable<lIn, rIn> extends true ? l | r : error<undiscriminatableMorphUnionMessage> : never;
|
|
25
|
-
type discriminatable<l, r> = discriminatableRecurse<l, r, []> extends never ? false : true;
|
|
26
|
-
type discriminatableRecurse<l, r, path extends string[]> = path["length"] extends 10 ? never : l & r extends never ? path : domainOf<l> & domainOf<r> extends never ? path : objectKindOf<l> & objectKindOf<r> extends never ? path : [objectKindOf<l>, objectKindOf<r>] extends ["Object", "Object"] ? extractValues<{
|
|
27
|
-
[k in requiredKeyOf<l>]: k extends requiredKeyOf<r> ? discriminatableRecurse<l[k], r[k], [...path, k & string]> : never;
|
|
28
|
-
}, string[]> : never;
|
|
29
|
-
export declare const compileDisjointReasonsMessage: (disjoints: DisjointsByPath) => string;
|
|
30
|
-
export declare const writeImplicitNeverMessage: <path extends [] | Path, operator extends "keyof" | "Intersection", description extends string = "">(path: asConst<path>, operator: operator, description?: description | undefined) => `${path extends [] ? "" : `At ${pathToString<path, "/">}: `}${operator} ${description extends "" ? "" : `${description} `}results in an unsatisfiable type`;
|
|
31
|
-
export type writeImplicitNeverMessage<path extends string[], operator extends "Intersection" | "keyof", description extends string = ""> = `${path extends [] ? "" : `At ${pathToString<path>}: `}${operator} ${description extends "" ? "" : `${description} `}results in an unsatisfiable type`;
|
|
32
|
-
export declare const writeUndiscriminatableMorphUnionMessage: <path extends string>(path: path) => string;
|
|
33
|
-
type undiscriminatableMorphUnionMessage = `A union including one or more morphs must be discriminatable`;
|
|
34
|
-
type isDivisible<data> = isAny<data> extends true ? false : [data] extends [number] ? true : false;
|
|
35
|
-
type isBoundable<data> = isAny<data> extends true ? false : [data] extends [SizedData] ? true : false;
|
|
36
|
-
export type inferTerminal<token, $> = token extends keyof $ ? resolve<token, $> : token extends StringLiteral<infer Text> ? Text : token extends RegexLiteral ? string : token extends number | bigint ? token : never;
|
|
37
|
-
export type astToString<ast> = `'${astToStringRecurse<ast, "">}'`;
|
|
38
|
-
type astToStringRecurse<ast, result extends string> = ast extends [
|
|
39
|
-
infer head,
|
|
40
|
-
...infer tail
|
|
41
|
-
] ? astToStringRecurse<tail, `${result}${astToStringRecurse<head, "">}`> : ast extends Literalable ? `${result}${ast extends bigint ? `${ast}n` : ast}` : "...";
|
|
42
|
-
export declare const writeIndivisibleMessage: <root extends string>(root: root) => `Divisibility operand ${root} must be a number`;
|
|
43
|
-
type writeIndivisibleMessage<root extends string> = `Divisibility operand ${root} must be a number`;
|
|
44
|
-
export declare const writeUnboundableMessage: <root extends string>(root: root) => `Bounded expression ${root} must be a number, string or array`;
|
|
45
|
-
type writeUnboundableMessage<root extends string> = `Bounded expression ${root} must be a number, string or array`;
|
|
46
|
-
export {};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { asOut } from "../../scopes/type.js";
|
|
2
|
-
import type { nominal } from "../../utils/generics.js";
|
|
3
|
-
import type { inferDefinition, validateDefinition } from "../definition.js";
|
|
4
|
-
import type { PostfixParser, TupleExpression } from "./tuple.js";
|
|
5
|
-
export declare const parseMorphTuple: PostfixParser<"=>">;
|
|
6
|
-
export type Out<t = {}> = nominal<t, "out">;
|
|
7
|
-
export type validateMorphTuple<def extends TupleExpression, $> = readonly [
|
|
8
|
-
_: validateDefinition<def[0], $>,
|
|
9
|
-
_: "=>",
|
|
10
|
-
_: Morph<asOut<inferDefinition<def[0], $>>, "3" extends keyof def ? inferDefinition<def[3], $> : unknown>,
|
|
11
|
-
_?: validateDefinition<def[3], $>
|
|
12
|
-
];
|
|
13
|
-
export type Morph<i = any, o = unknown> = (In: i) => o;
|
|
14
|
-
export type ParsedMorph<i = any, o = unknown> = (In: i) => Out<o>;
|
|
15
|
-
export declare const writeMalformedMorphExpressionMessage: (value: unknown) => string;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { asIn } from "../../scopes/type.js";
|
|
2
|
-
import type { Problems } from "../../traverse/problems.js";
|
|
3
|
-
import type { inferDefinition, validateDefinition } from "../definition.js";
|
|
4
|
-
import type { PostfixParser, TupleExpression } from "./tuple.js";
|
|
5
|
-
import type { distributable } from "./utils.js";
|
|
6
|
-
export declare const parseNarrowTuple: PostfixParser<":">;
|
|
7
|
-
export type Narrow<data = any> = (data: data, problems: Problems) => boolean;
|
|
8
|
-
export type validateNarrowTuple<def extends TupleExpression, $> = readonly [
|
|
9
|
-
_: validateDefinition<def[0], $>,
|
|
10
|
-
_: ":",
|
|
11
|
-
_: distributable<Narrow<asIn<inferDefinition<def[0], $>>>>,
|
|
12
|
-
_?: validateDefinition<def[3], $>
|
|
13
|
-
];
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import type { inferNode } from "../../nodes/infer.js";
|
|
2
|
-
import type { ResolvedNode, TypeNode } from "../../nodes/node.js";
|
|
3
|
-
import type { asIn, asOut } from "../../scopes/type.js";
|
|
4
|
-
import type { conform, constructor, error, List, returnOf } from "../../utils/generics.js";
|
|
5
|
-
import type { inferDefinition, ParseContext, validateDefinition } from "../definition.js";
|
|
6
|
-
import type { inferIntersection, inferUnion } from "../string/ast.js";
|
|
7
|
-
import { writeMissingRightOperandMessage } from "../string/shift/operand/unenclosed.js";
|
|
8
|
-
import type { Scanner } from "../string/shift/scanner.js";
|
|
9
|
-
import type { inferKeyOfExpression, validateKeyOfExpression } from "./keyof.js";
|
|
10
|
-
import type { Out, validateMorphTuple } from "./morph.js";
|
|
11
|
-
import type { validateNarrowTuple } from "./narrow.js";
|
|
12
|
-
export declare const parseTuple: (def: List, ctx: ParseContext) => TypeNode;
|
|
13
|
-
export type validateTupleExpression<def extends TupleExpression, $> = def[1] extends "=>" ? validateMorphTuple<def, $> : def[1] extends ":" ? validateNarrowTuple<def, $> : def[1] extends Scanner.BranchToken ? def[2] extends undefined ? [def[0], error<writeMissingRightOperandMessage<def[1], "">>] : conform<def, readonly [
|
|
14
|
-
validateDefinition<def[0], $>,
|
|
15
|
-
def[1],
|
|
16
|
-
validateDefinition<def[2], $>
|
|
17
|
-
]> : def[1] extends "[]" ? conform<def, readonly [validateDefinition<def[0], $>, "[]"]> : def[0] extends "===" ? conform<def, readonly ["===", unknown]> : def[0] extends "instanceof" ? conform<def, readonly ["instanceof", constructor]> : def[0] extends "node" ? conform<def, readonly ["node", ResolvedNode<$>]> : def[0] extends "keyof" ? validateKeyOfExpression<def[1], $> : never;
|
|
18
|
-
export type inferTuple<def extends List, $> = def extends TupleExpression ? inferTupleExpression<def, $> : {
|
|
19
|
-
[i in keyof def]: inferDefinition<def[i], $>;
|
|
20
|
-
};
|
|
21
|
-
export type inferTupleExpression<def extends TupleExpression, $> = def[1] extends ":" ? "3" extends keyof def ? inferDefinition<def[3], $> : inferDefinition<def[0], $> : def[1] extends "=>" ? (In: asIn<inferDefinition<def[0], $>>) => Out<"3" extends keyof def ? asOut<inferDefinition<def[3], $>> : returnOf<def[2]>> : def[1] extends "&" ? inferIntersection<inferDefinition<def[0], $>, inferDefinition<def[2], $>> : def[1] extends "|" ? inferUnion<inferDefinition<def[0], $>, inferDefinition<def[2], $>> : def[1] extends "[]" ? inferDefinition<def[0], $>[] : def[0] extends "===" ? def[1] : def[0] extends "instanceof" ? def[1] extends constructor<infer t> ? t : never : def[0] extends "node" ? def[1] extends ResolvedNode<$> ? inferNode<def[1], $> : never : def[0] extends "keyof" ? inferKeyOfExpression<def[1], $> : never;
|
|
22
|
-
export type PostfixParser<token extends PostfixToken> = (def: PostfixExpression<token>, ctx: ParseContext) => TypeNode;
|
|
23
|
-
export type PrefixParser<token extends PrefixToken> = (def: PrefixExpression<token>, ctx: ParseContext) => TypeNode;
|
|
24
|
-
export type TupleExpression = PrefixExpression | PostfixExpression;
|
|
25
|
-
export declare const writeMalformedFunctionalExpressionMessage: (operator: "=>" | ":", rightDef: unknown) => string;
|
|
26
|
-
export type TupleExpressionToken = PrefixToken | PostfixToken;
|
|
27
|
-
type PostfixToken = "[]" | "&" | "|" | ":" | "=>";
|
|
28
|
-
export type PostfixExpression<token extends PostfixToken = PostfixToken> = readonly [unknown, token, ...unknown[]];
|
|
29
|
-
type PrefixToken = "keyof" | "instanceof" | "===" | "node";
|
|
30
|
-
export type PrefixExpression<token extends PrefixToken = PrefixToken> = readonly [token, ...unknown[]];
|
|
31
|
-
export {};
|