arktype 2.0.0-dev.1 → 2.0.0-dev.10
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/__tests__/array.test.ts +270 -151
- package/__tests__/badDefinitionType.test.ts +10 -3
- package/__tests__/basis.test.ts +6 -2
- package/__tests__/bounds.test.ts +282 -352
- package/__tests__/cast.test.ts +7 -2
- package/__tests__/completions.test.ts +8 -3
- package/__tests__/config.test.ts +95 -167
- package/__tests__/dateLiteral.test.ts +8 -4
- package/__tests__/declared.test.ts +7 -6
- package/__tests__/discrimination.test.ts +1 -1
- package/__tests__/divisor.test.ts +46 -22
- package/__tests__/enclosed.test.ts +39 -25
- package/__tests__/examples.test.ts +56 -56
- package/__tests__/expressions.test.ts +184 -112
- package/__tests__/generic.test.ts +307 -288
- package/__tests__/group.test.ts +67 -54
- package/__tests__/imports.test.ts +62 -49
- package/__tests__/instanceof.test.ts +25 -23
- package/__tests__/intersection.test.ts +52 -48
- package/__tests__/keyTraversal.test.ts +77 -73
- package/__tests__/keyof.test.ts +68 -52
- package/__tests__/keywords.test.ts +164 -138
- package/__tests__/literal.test.ts +60 -21
- package/__tests__/match.bench.ts +31 -0
- package/__tests__/match.test.ts +222 -22
- package/__tests__/narrow.test.ts +52 -54
- package/__tests__/objectLiteral.test.ts +347 -205
- package/__tests__/operator.bench.ts +4 -4
- package/__tests__/pipe.test.ts +501 -0
- package/__tests__/realWorld.test.ts +63 -0
- package/__tests__/regex.test.ts +17 -7
- package/__tests__/scope.bench.ts +1 -1
- package/__tests__/scope.test.ts +257 -23
- package/__tests__/serialization.test.ts +19 -0
- package/__tests__/string.test.ts +11 -7
- package/__tests__/submodule.test.ts +26 -39
- package/__tests__/this.test.ts +83 -57
- package/__tests__/thunk.test.ts +13 -7
- package/__tests__/traverse.test.ts +76 -54
- package/__tests__/tsGenerics.test.ts +12 -12
- package/__tests__/type.test.ts +36 -0
- package/__tests__/typeReference.test.ts +7 -7
- package/__tests__/unenclosed.test.ts +116 -100
- package/__tests__/union.test.ts +171 -104
- package/ark.ts +21 -65
- package/generic.ts +69 -0
- package/main.ts +6 -18
- package/match.ts +195 -93
- package/module.ts +15 -0
- package/out/ark.d.ts +15 -39
- package/out/ark.js +9 -18
- package/out/ark.js.map +1 -1
- package/out/generic.d.ts +21 -0
- package/out/generic.js +24 -0
- package/out/generic.js.map +1 -0
- package/out/main.d.ts +6 -7
- package/out/main.js +4 -3
- package/out/main.js.map +1 -1
- package/out/match.d.ts +57 -34
- package/out/match.js +51 -17
- package/out/match.js.map +1 -1
- package/out/module.d.ts +10 -0
- package/out/module.js +3 -0
- package/out/module.js.map +1 -0
- package/out/parser/definition.d.ts +11 -13
- package/out/parser/definition.js +10 -13
- package/out/parser/definition.js.map +1 -1
- package/out/parser/generic.d.ts +5 -7
- package/out/parser/generic.js +7 -11
- package/out/parser/generic.js.map +1 -1
- package/out/parser/objectLiteral.d.ts +45 -14
- package/out/parser/objectLiteral.js +61 -52
- package/out/parser/objectLiteral.js.map +1 -1
- package/out/parser/semantic/bounds.d.ts +10 -8
- package/out/parser/semantic/bounds.js +0 -1
- package/out/parser/semantic/bounds.js.map +1 -1
- package/out/parser/semantic/divisor.d.ts +5 -7
- package/out/parser/semantic/divisor.js +0 -1
- package/out/parser/semantic/infer.d.ts +24 -0
- package/out/parser/semantic/infer.js +1 -0
- package/out/parser/semantic/infer.js.map +1 -0
- package/out/parser/semantic/utils.d.ts +3 -7
- package/out/parser/semantic/utils.js +0 -1
- package/out/parser/semantic/validate.d.ts +15 -14
- package/out/parser/semantic/validate.js +1 -1
- package/out/parser/semantic/validate.js.map +1 -1
- package/out/parser/string/reduce/dynamic.d.ts +13 -13
- package/out/parser/string/reduce/dynamic.js +31 -26
- package/out/parser/string/reduce/dynamic.js.map +1 -1
- package/out/parser/string/reduce/shared.d.ts +6 -20
- package/out/parser/string/reduce/shared.js +0 -1
- package/out/parser/string/reduce/shared.js.map +1 -1
- package/out/parser/string/reduce/static.d.ts +27 -24
- package/out/parser/string/reduce/static.js +0 -1
- package/out/parser/string/shift/operand/date.d.ts +3 -3
- package/out/parser/string/shift/operand/date.js +4 -7
- package/out/parser/string/shift/operand/date.js.map +1 -1
- package/out/parser/string/shift/operand/enclosed.d.ts +4 -19
- package/out/parser/string/shift/operand/enclosed.js +12 -13
- package/out/parser/string/shift/operand/enclosed.js.map +1 -1
- package/out/parser/string/shift/operand/genericArgs.d.ts +9 -10
- package/out/parser/string/shift/operand/genericArgs.js +6 -10
- package/out/parser/string/shift/operand/genericArgs.js.map +1 -1
- package/out/parser/string/shift/operand/operand.d.ts +3 -4
- package/out/parser/string/shift/operand/operand.js +8 -12
- package/out/parser/string/shift/operand/operand.js.map +1 -1
- package/out/parser/string/shift/operand/unenclosed.d.ts +15 -22
- package/out/parser/string/shift/operand/unenclosed.js +24 -36
- package/out/parser/string/shift/operand/unenclosed.js.map +1 -1
- package/out/parser/string/shift/operator/bounds.d.ts +9 -13
- package/out/parser/string/shift/operator/bounds.js +43 -54
- package/out/parser/string/shift/operator/bounds.js.map +1 -1
- package/out/parser/string/shift/operator/divisor.d.ts +2 -4
- package/out/parser/string/shift/operator/divisor.js +1 -3
- package/out/parser/string/shift/operator/divisor.js.map +1 -1
- package/out/parser/string/shift/operator/operator.d.ts +2 -3
- package/out/parser/string/shift/operator/operator.js +12 -19
- package/out/parser/string/shift/operator/operator.js.map +1 -1
- package/out/parser/string/shift/scanner.d.ts +2 -2
- package/out/parser/string/shift/scanner.js +14 -16
- package/out/parser/string/shift/scanner.js.map +1 -1
- package/out/parser/string/string.d.ts +8 -6
- package/out/parser/string/string.js +1 -3
- package/out/parser/string/string.js.map +1 -1
- package/out/parser/tuple.d.ts +102 -43
- package/out/parser/tuple.js +119 -87
- package/out/parser/tuple.js.map +1 -1
- package/out/scope.d.ts +43 -120
- package/out/scope.js +39 -209
- package/out/scope.js.map +1 -1
- package/out/type.d.ts +43 -64
- package/out/type.js +30 -131
- package/out/type.js.map +1 -1
- package/package.json +7 -3
- package/parser/definition.ts +77 -93
- package/parser/generic.ts +38 -40
- package/parser/objectLiteral.ts +172 -136
- package/parser/semantic/bounds.ts +33 -32
- package/parser/semantic/divisor.ts +8 -10
- package/parser/semantic/infer.ts +141 -0
- package/parser/semantic/utils.ts +12 -23
- package/parser/semantic/validate.ts +81 -73
- package/parser/string/reduce/dynamic.ts +67 -55
- package/parser/string/reduce/shared.ts +1 -3
- package/parser/string/reduce/static.ts +67 -69
- package/parser/string/shift/operand/date.ts +15 -14
- package/parser/string/shift/operand/enclosed.ts +30 -25
- package/parser/string/shift/operand/genericArgs.ts +46 -45
- package/parser/string/shift/operand/operand.ts +32 -38
- package/parser/string/shift/operand/unenclosed.ts +107 -158
- package/parser/string/shift/operator/bounds.ts +118 -112
- package/parser/string/shift/operator/divisor.ts +14 -17
- package/parser/string/shift/operator/operator.ts +35 -46
- package/parser/string/shift/scanner.ts +51 -50
- package/parser/string/string.ts +30 -35
- package/parser/tuple.ts +375 -307
- package/scope.ts +170 -453
- package/type.ts +193 -274
- package/__tests__/astUtils.test.ts +0 -17
- package/__tests__/cyclic.test.ts +0 -144
- package/__tests__/jsdoc.test.ts +0 -64
- package/__tests__/morph.test.ts +0 -409
- package/__tests__/nodeDefinitions.test.ts +0 -190
- package/__tests__/typeMethods.test.ts +0 -69
- package/out/ark.d.ts.map +0 -1
- package/out/arkConfig.d.ts +0 -2
- package/out/arkConfig.d.ts.map +0 -1
- package/out/arkConfig.js +0 -10
- package/out/arkConfig.js.map +0 -1
- package/out/main.d.ts.map +0 -1
- package/out/match.d.ts.map +0 -1
- package/out/parser/definition.d.ts.map +0 -1
- package/out/parser/generic.d.ts.map +0 -1
- package/out/parser/objectLiteral.d.ts.map +0 -1
- package/out/parser/semantic/bounds.d.ts.map +0 -1
- package/out/parser/semantic/divisor.d.ts.map +0 -1
- package/out/parser/semantic/intersections.d.ts +0 -14
- package/out/parser/semantic/intersections.d.ts.map +0 -1
- package/out/parser/semantic/intersections.js +0 -2
- package/out/parser/semantic/intersections.js.map +0 -1
- package/out/parser/semantic/semantic.d.ts +0 -33
- package/out/parser/semantic/semantic.d.ts.map +0 -1
- package/out/parser/semantic/semantic.js +0 -2
- package/out/parser/semantic/semantic.js.map +0 -1
- package/out/parser/semantic/utils.d.ts.map +0 -1
- package/out/parser/semantic/validate.d.ts.map +0 -1
- package/out/parser/shared.d.ts +0 -54
- package/out/parser/shared.d.ts.map +0 -1
- package/out/parser/shared.js +0 -47
- package/out/parser/shared.js.map +0 -1
- package/out/parser/string/reduce/dynamic.d.ts.map +0 -1
- package/out/parser/string/reduce/shared.d.ts.map +0 -1
- package/out/parser/string/reduce/static.d.ts.map +0 -1
- package/out/parser/string/shift/operand/date.d.ts.map +0 -1
- package/out/parser/string/shift/operand/enclosed.d.ts.map +0 -1
- package/out/parser/string/shift/operand/genericArgs.d.ts.map +0 -1
- package/out/parser/string/shift/operand/operand.d.ts.map +0 -1
- package/out/parser/string/shift/operand/unenclosed.d.ts.map +0 -1
- package/out/parser/string/shift/operator/bounds.d.ts.map +0 -1
- package/out/parser/string/shift/operator/divisor.d.ts.map +0 -1
- package/out/parser/string/shift/operator/operator.d.ts.map +0 -1
- package/out/parser/string/shift/scanner.d.ts.map +0 -1
- package/out/parser/string/string.d.ts.map +0 -1
- package/out/parser/tuple.d.ts.map +0 -1
- package/out/scope.d.ts.map +0 -1
- package/out/test.d.ts +0 -2
- package/out/test.d.ts.map +0 -1
- package/out/test.js +0 -7
- package/out/test.js.map +0 -1
- package/out/tsconfig.build.tsbuildinfo +0 -1
- package/out/type.d.ts.map +0 -1
- package/out/util.d.ts +0 -19
- package/out/util.d.ts.map +0 -1
- package/out/util.js +0 -7
- package/out/util.js.map +0 -1
- package/parser/semantic/intersections.ts +0 -46
- package/parser/semantic/semantic.ts +0 -144
- package/parser/shared.ts +0 -152
- package/util.ts +0 -36
package/out/parser/tuple.d.ts
CHANGED
|
@@ -1,58 +1,119 @@
|
|
|
1
|
-
import { type BaseMeta, type Morph, type Out, type Predicate, type
|
|
2
|
-
import { type Constructor, type Domain, type
|
|
1
|
+
import { type BaseMeta, type Morph, type Out, type Predicate, type RawSchema, type distillConstrainableIn, type distillConstrainableOut, type inferIntersection, type inferMorphOut, type inferNarrow } from "@arktype/schema";
|
|
2
|
+
import { type Constructor, type Domain, type ErrorMessage, type array, type conform, type show } from "@arktype/util";
|
|
3
3
|
import type { ParseContext } from "../scope.js";
|
|
4
4
|
import type { inferDefinition, validateDefinition } from "./definition.js";
|
|
5
|
-
import type {
|
|
6
|
-
import type { InfixOperator, PostfixExpression } from "./semantic/semantic.js";
|
|
7
|
-
import { parseEntry, type EntryParseResult, type validateObjectValue } from "./shared.js";
|
|
5
|
+
import type { InfixOperator, PostfixExpression } from "./semantic/infer.js";
|
|
8
6
|
import { writeMissingRightOperandMessage } from "./string/shift/operand/unenclosed.js";
|
|
9
7
|
import type { BaseCompletions } from "./string/string.js";
|
|
10
|
-
export declare const parseTuple: (def:
|
|
11
|
-
export declare const parseTupleLiteral: (def:
|
|
12
|
-
export declare const maybeParseTupleExpression: (def: List, ctx: ParseContext) => TypeNode | undefined;
|
|
8
|
+
export declare const parseTuple: (def: array, ctx: ParseContext) => RawSchema;
|
|
9
|
+
export declare const parseTupleLiteral: (def: array, ctx: ParseContext) => RawSchema;
|
|
13
10
|
type InfixExpression = readonly [unknown, InfixOperator, ...unknown[]];
|
|
14
|
-
export type validateTuple<def extends
|
|
15
|
-
def[0] extends "" ? BaseCompletions<$, args, IndexZeroOperator> : def[0],
|
|
16
|
-
def[1] extends "" ? BaseCompletions<$, args, IndexOneOperator> : def[1]
|
|
11
|
+
export type validateTuple<def extends array, $, args> = def extends IndexZeroExpression ? validatePrefixExpression<def, $, args> : def extends PostfixExpression ? validatePostfixExpression<def, $, args> : def extends InfixExpression ? validateInfixExpression<def, $, args> : def extends (readonly ["", ...unknown[]] | readonly [unknown, "", ...unknown[]]) ? readonly [
|
|
12
|
+
def[0] extends "" ? BaseCompletions<$, args, IndexZeroOperator | "..."> : def[0],
|
|
13
|
+
def[1] extends "" ? BaseCompletions<$, args, IndexOneOperator | "..." | "?"> : def[1]
|
|
17
14
|
] : validateTupleLiteral<def, $, args>;
|
|
18
|
-
export type validateTupleLiteral<def extends
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
type
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
type
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
15
|
+
export type validateTupleLiteral<def extends array, $, args> = Readonly<parseSequence<def, $, args>["validated"]>;
|
|
16
|
+
type inferTupleLiteral<def extends array, $, args> = parseSequence<def, $, args>["inferred"];
|
|
17
|
+
type SequenceParseState = {
|
|
18
|
+
unscanned: array;
|
|
19
|
+
inferred: array;
|
|
20
|
+
validated: array;
|
|
21
|
+
};
|
|
22
|
+
type parseSequence<def extends array, $, args> = parseNextElement<{
|
|
23
|
+
unscanned: def;
|
|
24
|
+
inferred: [];
|
|
25
|
+
validated: [];
|
|
26
|
+
}, $, args>;
|
|
27
|
+
type PreparsedElement = {
|
|
28
|
+
head: unknown;
|
|
29
|
+
tail: array;
|
|
30
|
+
optional: boolean;
|
|
31
|
+
spread: boolean;
|
|
32
|
+
};
|
|
33
|
+
declare namespace PreparsedElement {
|
|
34
|
+
type from<result extends PreparsedElement> = result;
|
|
35
|
+
}
|
|
36
|
+
type preparseNextElement<s extends SequenceParseState> = s["unscanned"] extends readonly ["...", infer head, ...infer tail] ? tail extends readonly ["?", ...infer postOptionalTail] ? PreparsedElement.from<{
|
|
37
|
+
head: head;
|
|
38
|
+
tail: postOptionalTail;
|
|
39
|
+
optional: true;
|
|
40
|
+
spread: true;
|
|
41
|
+
}> : PreparsedElement.from<{
|
|
42
|
+
head: head;
|
|
43
|
+
tail: tail;
|
|
44
|
+
optional: false;
|
|
45
|
+
spread: true;
|
|
46
|
+
}> : s["unscanned"] extends readonly [infer head, "?", ...infer tail] ? PreparsedElement.from<{
|
|
47
|
+
head: head;
|
|
48
|
+
tail: tail;
|
|
49
|
+
optional: true;
|
|
50
|
+
spread: false;
|
|
51
|
+
}> : s["unscanned"] extends readonly [infer head, ...infer tail] ? PreparsedElement.from<{
|
|
52
|
+
head: head;
|
|
53
|
+
tail: tail;
|
|
54
|
+
optional: false;
|
|
55
|
+
spread: false;
|
|
56
|
+
}> : null;
|
|
57
|
+
type parseNextElement<s extends SequenceParseState, $, args> = preparseNextElement<s> extends infer next extends PreparsedElement ? parseNextElement<{
|
|
58
|
+
unscanned: next["tail"];
|
|
59
|
+
inferred: next["spread"] extends true ? [
|
|
60
|
+
...s["inferred"],
|
|
61
|
+
...conform<inferDefinition<next["head"], $, args>, array>
|
|
62
|
+
] : next["optional"] extends true ? [
|
|
63
|
+
...s["inferred"],
|
|
64
|
+
inferDefinition<next["head"], $, args>?
|
|
65
|
+
] : [...s["inferred"], inferDefinition<next["head"], $, args>];
|
|
66
|
+
validated: [
|
|
67
|
+
...s["validated"],
|
|
68
|
+
...(next["spread"] extends true ? [
|
|
69
|
+
inferDefinition<next["head"], $, args> extends (infer spreadOperand extends array) ? [
|
|
70
|
+
number,
|
|
71
|
+
number
|
|
72
|
+
] extends ([
|
|
73
|
+
s["inferred"]["length"],
|
|
74
|
+
spreadOperand["length"]
|
|
75
|
+
]) ? ErrorMessage<multipleVariadicMessage> : "..." : ErrorMessage<writeNonArraySpreadMessage<next["head"]>>
|
|
76
|
+
] : []),
|
|
77
|
+
[
|
|
78
|
+
next["optional"] | next["spread"],
|
|
79
|
+
"?"
|
|
80
|
+
] extends ([
|
|
81
|
+
false,
|
|
82
|
+
s["validated"][number]
|
|
83
|
+
]) ? ErrorMessage<requiredPostOptionalMessage> : validateDefinition<next["head"], $, args>,
|
|
84
|
+
...(next["optional"] extends true ? [
|
|
85
|
+
next["spread"] extends true ? ErrorMessage<spreadOptionalMessage> : number extends s["inferred"]["length"] ? ErrorMessage<optionalPostVariadicMessage> : "?"
|
|
86
|
+
] : [])
|
|
87
|
+
];
|
|
88
|
+
}, $, args> : s;
|
|
89
|
+
export declare const writeNonArraySpreadMessage: <operand extends string>(operand: operand) => writeNonArraySpreadMessage<operand>;
|
|
90
|
+
type writeNonArraySpreadMessage<operand> = `Spread element must be an array${operand extends string ? `(was ${operand})` : ""}`;
|
|
91
|
+
export declare const multipleVariadicMesage = "A tuple may have at most one variadic element";
|
|
92
|
+
type multipleVariadicMessage = typeof multipleVariadicMesage;
|
|
93
|
+
export declare const requiredPostOptionalMessage = "A required element may not follow an optional element";
|
|
94
|
+
type requiredPostOptionalMessage = typeof requiredPostOptionalMessage;
|
|
95
|
+
export declare const optionalPostVariadicMessage = "An optional element may not follow a variadic element";
|
|
96
|
+
type optionalPostVariadicMessage = typeof optionalPostVariadicMessage;
|
|
97
|
+
export declare const spreadOptionalMessage = "A spread element cannot be optional";
|
|
98
|
+
type spreadOptionalMessage = typeof optionalPostVariadicMessage;
|
|
99
|
+
export type inferTuple<def extends array, $, args> = def extends TupleExpression ? inferTupleExpression<def, $, args> : inferTupleLiteral<def, $, args>;
|
|
100
|
+
export type inferTupleExpression<def extends TupleExpression, $, args> = def[1] extends "[]" ? inferDefinition<def[0], $, args>[] : def[1] extends "&" ? inferIntersection<inferDefinition<def[0], $, args>, inferDefinition<def[2], $, args>> : def[1] extends "|" ? inferDefinition<def[0], $, args> | inferDefinition<def[2], $, args> : def[1] extends ":" ? inferNarrow<inferDefinition<def[0], $, args>, def[2]> : def[1] extends "=>" ? parseMorph<def[0], def[2], $, args> : def[1] extends "@" ? inferDefinition<def[0], $, args> : def extends readonly ["===", ...infer values] ? values[number] : def extends (readonly ["instanceof", ...infer constructors extends Constructor[]]) ? InstanceType<constructors[number]> : def[0] extends "keyof" ? inferKeyOfExpression<def[1], $, args> : never;
|
|
40
101
|
export type validatePrefixExpression<def extends IndexZeroExpression, $, args> = def["length"] extends 1 ? readonly [writeMissingRightOperandMessage<def[0]>] : def[0] extends "keyof" ? readonly [def[0], validateDefinition<def[1], $, args>] : def[0] extends "===" ? readonly [def[0], ...unknown[]] : def[0] extends "instanceof" ? readonly [def[0], ...Constructor[]] : never;
|
|
41
102
|
export type validatePostfixExpression<def extends PostfixExpression, $, args> = conform<def, readonly [validateDefinition<def[0], $, args>, "[]"]>;
|
|
42
103
|
export type validateInfixExpression<def extends InfixExpression, $, args> = def["length"] extends 2 ? readonly [def[0], writeMissingRightOperandMessage<def[1]>] : readonly [
|
|
43
104
|
validateDefinition<def[0], $, args>,
|
|
44
105
|
def[1],
|
|
45
|
-
def[1] extends "|" ? validateDefinition<def[2], $, args> : def[1] extends "&" ? validateDefinition<def[2], $, args> : def[1] extends ":" ? Predicate<
|
|
106
|
+
def[1] extends "|" ? validateDefinition<def[2], $, args> : def[1] extends "&" ? validateDefinition<def[2], $, args> : def[1] extends ":" ? Predicate<distillConstrainableIn<inferDefinition<def[0], $, args>>> : def[1] extends "=>" ? Morph<distillConstrainableOut<inferDefinition<def[0], $, args>>, unknown> : def[1] extends "@" ? BaseMeta | string : validateDefinition<def[2], $, args>
|
|
46
107
|
];
|
|
47
108
|
export type UnparsedTupleExpressionInput = {
|
|
48
109
|
instanceof: Constructor;
|
|
49
110
|
"===": unknown;
|
|
50
111
|
};
|
|
51
|
-
export type UnparsedTupleOperator =
|
|
112
|
+
export type UnparsedTupleOperator = show<keyof UnparsedTupleExpressionInput>;
|
|
52
113
|
export declare const parseKeyOfTuple: PrefixParser<"keyof">;
|
|
53
|
-
export type inferKeyOfExpression<operandDef, $, args> =
|
|
54
|
-
export type PostfixParser<token extends IndexOneOperator> = (def: IndexOneExpression<token>, ctx: ParseContext) =>
|
|
55
|
-
export type PrefixParser<token extends IndexZeroOperator> = (def: IndexZeroExpression<token>, ctx: ParseContext) =>
|
|
114
|
+
export type inferKeyOfExpression<operandDef, $, args> = show<keyof inferDefinition<operandDef, $, args>>;
|
|
115
|
+
export type PostfixParser<token extends IndexOneOperator> = (def: IndexOneExpression<token>, ctx: ParseContext) => RawSchema;
|
|
116
|
+
export type PrefixParser<token extends IndexZeroOperator> = (def: IndexZeroExpression<token>, ctx: ParseContext) => RawSchema;
|
|
56
117
|
export type TupleExpression = IndexZeroExpression | IndexOneExpression;
|
|
57
118
|
export type TupleExpressionOperator = IndexZeroOperator | IndexOneOperator;
|
|
58
119
|
export type IndexOneOperator = TuplePostfixOperator | TupleInfixOperator;
|
|
@@ -60,12 +121,10 @@ export type TuplePostfixOperator = "[]";
|
|
|
60
121
|
export type TupleInfixOperator = "&" | "|" | "=>" | ":" | "@";
|
|
61
122
|
export type IndexOneExpression<token extends IndexOneOperator = IndexOneOperator> = readonly [unknown, token, ...unknown[]];
|
|
62
123
|
export declare const parseMorphTuple: PostfixParser<"=>">;
|
|
63
|
-
export declare const writeMalformedFunctionalExpressionMessage: (operator:
|
|
64
|
-
export type parseMorph<inDef, morph, $, args> = morph extends Morph ? (In:
|
|
124
|
+
export declare const writeMalformedFunctionalExpressionMessage: (operator: ":" | "=>", value: unknown) => "Narrow expression requires a function following ':' (was string)" | "Narrow expression requires a function following ':' (was number)" | "Narrow expression requires a function following ':' (was bigint)" | "Narrow expression requires a function following ':' (was boolean)" | "Narrow expression requires a function following ':' (was symbol)" | "Narrow expression requires a function following ':' (was undefined)" | "Narrow expression requires a function following ':' (was object)" | "Narrow expression requires a function following ':' (was function)" | "Narrow expression requires a function following '=>' (was string)" | "Narrow expression requires a function following '=>' (was number)" | "Narrow expression requires a function following '=>' (was bigint)" | "Narrow expression requires a function following '=>' (was boolean)" | "Narrow expression requires a function following '=>' (was symbol)" | "Narrow expression requires a function following '=>' (was undefined)" | "Narrow expression requires a function following '=>' (was object)" | "Narrow expression requires a function following '=>' (was function)" | "Morph expression requires a function following ':' (was string)" | "Morph expression requires a function following ':' (was number)" | "Morph expression requires a function following ':' (was bigint)" | "Morph expression requires a function following ':' (was boolean)" | "Morph expression requires a function following ':' (was symbol)" | "Morph expression requires a function following ':' (was undefined)" | "Morph expression requires a function following ':' (was object)" | "Morph expression requires a function following ':' (was function)" | "Morph expression requires a function following '=>' (was string)" | "Morph expression requires a function following '=>' (was number)" | "Morph expression requires a function following '=>' (was bigint)" | "Morph expression requires a function following '=>' (was boolean)" | "Morph expression requires a function following '=>' (was symbol)" | "Morph expression requires a function following '=>' (was undefined)" | "Morph expression requires a function following '=>' (was object)" | "Morph expression requires a function following '=>' (was function)";
|
|
125
|
+
export type parseMorph<inDef, morph, $, args> = morph extends Morph ? (In: distillConstrainableIn<inferDefinition<inDef, $, args>>) => Out<inferMorphOut<morph>> : never;
|
|
65
126
|
export declare const parseNarrowTuple: PostfixParser<":">;
|
|
66
|
-
export type FunctionalTupleOperator = ":" | "=>";
|
|
67
127
|
export type IndexZeroOperator = "keyof" | "instanceof" | "===";
|
|
68
128
|
export type IndexZeroExpression<token extends IndexZeroOperator = IndexZeroOperator> = readonly [token, ...unknown[]];
|
|
69
|
-
export declare const writeInvalidConstructorMessage: <actual extends "Array" | "Date" | "Error" | "Function" | "Map" | "RegExp" | "Set" | "String" | "Number" | "Boolean" | "WeakMap" | "WeakSet" | "Promise"
|
|
129
|
+
export declare const writeInvalidConstructorMessage: <actual extends Domain | "Array" | "Date" | "Error" | "Function" | "Map" | "RegExp" | "Set" | "String" | "Number" | "Boolean" | "WeakMap" | "WeakSet" | "Promise">(actual: actual) => `Expected a constructor following 'instanceof' operator (was ${actual})`;
|
|
70
130
|
export {};
|
|
71
|
-
//# sourceMappingURL=tuple.d.ts.map
|
package/out/parser/tuple.js
CHANGED
|
@@ -1,114 +1,145 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { writeUnsatisfiableExpressionError } from "./semantic/validate.js";
|
|
4
|
-
import { parseEntry } from "./shared.js";
|
|
1
|
+
import { jsObjects, makeRootAndArrayPropertiesMutable, tsKeywords } from "@arktype/schema";
|
|
2
|
+
import { append, objectKindOrDomainOf, throwParseError } from "@arktype/util";
|
|
5
3
|
import { writeMissingRightOperandMessage } from "./string/shift/operand/unenclosed.js";
|
|
6
4
|
export const parseTuple = (def, ctx) => maybeParseTupleExpression(def, ctx) ?? parseTupleLiteral(def, ctx);
|
|
7
5
|
export const parseTupleLiteral = (def, ctx) => {
|
|
8
|
-
|
|
9
|
-
let
|
|
10
|
-
|
|
11
|
-
let
|
|
12
|
-
|
|
13
|
-
if (
|
|
14
|
-
|
|
15
|
-
|
|
6
|
+
let sequences = [{}];
|
|
7
|
+
let i = 0;
|
|
8
|
+
while (i < def.length) {
|
|
9
|
+
let spread = false;
|
|
10
|
+
let optional = false;
|
|
11
|
+
if (def[i] === "..." && i < def.length - 1) {
|
|
12
|
+
spread = true;
|
|
13
|
+
i++;
|
|
16
14
|
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
15
|
+
const element = ctx.$.parse(def[i], ctx);
|
|
16
|
+
i++;
|
|
17
|
+
if (def[i] === "?") {
|
|
18
|
+
if (spread)
|
|
19
|
+
return throwParseError(spreadOptionalMessage);
|
|
20
|
+
optional = true;
|
|
21
|
+
i++;
|
|
22
22
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
// TODO: Fix builtins.arrayIndexTypeNode()
|
|
33
|
-
const elementType = value.getPath();
|
|
34
|
-
// TODO: first variadic i
|
|
35
|
-
props.push({ key: keywords.number, value: elementType });
|
|
23
|
+
if (spread) {
|
|
24
|
+
if (!element.extends(jsObjects.Array))
|
|
25
|
+
return throwParseError(writeNonArraySpreadMessage(element.expression));
|
|
26
|
+
// a spread must be distributed over branches e.g.:
|
|
27
|
+
// def: [string, ...(number[] | [true, false])]
|
|
28
|
+
// nodes: [string, ...number[]] | [string, true, false]
|
|
29
|
+
sequences = sequences.flatMap(base =>
|
|
30
|
+
// since appendElement mutates base, we have to shallow-ish clone it for each branch
|
|
31
|
+
element.branches.map(branch => appendSpreadBranch(makeRootAndArrayPropertiesMutable(base), branch)));
|
|
36
32
|
}
|
|
37
33
|
else {
|
|
38
|
-
|
|
39
|
-
key: {
|
|
40
|
-
name: `${i}`,
|
|
41
|
-
prerequisite: false,
|
|
42
|
-
optional: parsedEntry.kind === "optional"
|
|
43
|
-
},
|
|
44
|
-
value
|
|
45
|
-
});
|
|
34
|
+
sequences = sequences.map(base => appendElement(base, optional ? "optional" : "required", element));
|
|
46
35
|
}
|
|
47
|
-
ctx.path.pop();
|
|
48
36
|
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
37
|
+
return ctx.$.raw.schema(sequences.map(sequence => ({
|
|
38
|
+
proto: Array,
|
|
39
|
+
sequence
|
|
40
|
+
})));
|
|
41
|
+
};
|
|
42
|
+
const appendElement = (base, kind, element) => {
|
|
43
|
+
switch (kind) {
|
|
44
|
+
case "required":
|
|
45
|
+
if (base.optional)
|
|
46
|
+
// e.g. [string?, number]
|
|
47
|
+
return throwParseError(requiredPostOptionalMessage);
|
|
48
|
+
if (base.variadic) {
|
|
49
|
+
// e.g. [...string[], number]
|
|
50
|
+
base.postfix = append(base.postfix, element);
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
// e.g. [string, number]
|
|
54
|
+
base.prefix = append(base.prefix, element);
|
|
55
|
+
}
|
|
56
|
+
return base;
|
|
57
|
+
case "optional":
|
|
58
|
+
if (base.variadic)
|
|
59
|
+
// e.g. [...string[], number?]
|
|
60
|
+
return throwParseError(optionalPostVariadicMessage);
|
|
61
|
+
// e.g. [string, number?]
|
|
62
|
+
base.optional = append(base.optional, element);
|
|
63
|
+
return base;
|
|
64
|
+
case "variadic":
|
|
65
|
+
// e.g. [...string[], number, ...string[]]
|
|
66
|
+
if (base.postfix)
|
|
67
|
+
throwParseError(multipleVariadicMesage);
|
|
68
|
+
if (base.variadic) {
|
|
69
|
+
if (!base.variadic.equals(element)) {
|
|
70
|
+
// e.g. [...string[], ...number[]]
|
|
71
|
+
throwParseError(multipleVariadicMesage);
|
|
72
|
+
}
|
|
73
|
+
// e.g. [...string[], ...string[]]
|
|
74
|
+
// do nothing, second spread doesn't change the type
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
// e.g. [string, ...number[]]
|
|
78
|
+
base.variadic = element.raw;
|
|
79
|
+
}
|
|
80
|
+
return base;
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
const appendSpreadBranch = (base, branch) => {
|
|
84
|
+
const spread = branch.firstReferenceOfKind("sequence");
|
|
85
|
+
if (!spread) {
|
|
86
|
+
// the only array with no sequence reference is unknown[]
|
|
87
|
+
return appendElement(base, "variadic", tsKeywords.unknown);
|
|
59
88
|
}
|
|
60
|
-
|
|
61
|
-
|
|
89
|
+
spread.prefix.forEach(node => appendElement(base, "required", node));
|
|
90
|
+
spread.optional.forEach(node => appendElement(base, "optional", node));
|
|
91
|
+
spread.variadic && appendElement(base, "variadic", spread.variadic);
|
|
92
|
+
spread.postfix.forEach(node => appendElement(base, "required", node));
|
|
93
|
+
return base;
|
|
62
94
|
};
|
|
63
|
-
|
|
64
|
-
const tupleExpressionResult =
|
|
65
|
-
? indexOneParsers[def[1]](def, ctx)
|
|
66
|
-
: isIndexZeroExpression(def)
|
|
67
|
-
? prefixParsers[def[0]](def, ctx)
|
|
95
|
+
const maybeParseTupleExpression = (def, ctx) => {
|
|
96
|
+
const tupleExpressionResult = isIndexZeroExpression(def) ? prefixParsers[def[0]](def, ctx)
|
|
97
|
+
: isIndexOneExpression(def) ? indexOneParsers[def[1]](def, ctx)
|
|
68
98
|
: undefined;
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
99
|
+
return tupleExpressionResult;
|
|
100
|
+
// TODO: remove
|
|
101
|
+
// return tupleExpressionResult.isNever()
|
|
102
|
+
// ? throwParseError(
|
|
103
|
+
// writeUnsatisfiableExpressionError(
|
|
104
|
+
// def
|
|
105
|
+
// .map((def) =>
|
|
106
|
+
// typeof def === "string" ? def : printable(def)
|
|
107
|
+
// )
|
|
108
|
+
// .join(" ")
|
|
109
|
+
// )
|
|
110
|
+
// )
|
|
111
|
+
// : tupleExpressionResult
|
|
76
112
|
};
|
|
77
|
-
export const
|
|
78
|
-
export const
|
|
79
|
-
export const
|
|
113
|
+
export const writeNonArraySpreadMessage = (operand) => `Spread element must be an array (was ${operand})`;
|
|
114
|
+
export const multipleVariadicMesage = "A tuple may have at most one variadic element";
|
|
115
|
+
export const requiredPostOptionalMessage = "A required element may not follow an optional element";
|
|
116
|
+
export const optionalPostVariadicMessage = "An optional element may not follow a variadic element";
|
|
117
|
+
export const spreadOptionalMessage = "A spread element cannot be optional";
|
|
118
|
+
export const parseKeyOfTuple = (def, ctx) => ctx.$.parse(def[1], ctx).keyof();
|
|
80
119
|
const parseBranchTuple = (def, ctx) => {
|
|
81
|
-
if (def[2] === undefined)
|
|
120
|
+
if (def[2] === undefined)
|
|
82
121
|
return throwParseError(writeMissingRightOperandMessage(def[1], ""));
|
|
83
|
-
|
|
84
|
-
const
|
|
85
|
-
const r = ctx.scope.parse(def[2], ctx);
|
|
122
|
+
const l = ctx.$.parse(def[0], ctx);
|
|
123
|
+
const r = ctx.$.parse(def[2], ctx);
|
|
86
124
|
return def[1] === "&" ? l.and(r) : l.or(r);
|
|
87
125
|
};
|
|
88
|
-
const parseArrayTuple = (def, ctx) => ctx
|
|
126
|
+
const parseArrayTuple = (def, ctx) => ctx.$.parse(def[0], ctx).array();
|
|
89
127
|
const isIndexOneExpression = (def) => indexOneParsers[def[1]] !== undefined;
|
|
90
128
|
export const parseMorphTuple = (def, ctx) => {
|
|
91
129
|
if (typeof def[2] !== "function") {
|
|
92
130
|
return throwParseError(writeMalformedFunctionalExpressionMessage("=>", def[2]));
|
|
93
131
|
}
|
|
94
132
|
// TODO: nested morphs?
|
|
95
|
-
return
|
|
96
|
-
in: ctx.scope.parse(def[0], ctx),
|
|
97
|
-
morph: def[2]
|
|
98
|
-
});
|
|
133
|
+
return ctx.$.parse(def[0], ctx).pipe(def[2]);
|
|
99
134
|
};
|
|
100
135
|
export const writeMalformedFunctionalExpressionMessage = (operator, value) => `${operator === ":" ? "Narrow" : "Morph"} expression requires a function following '${operator}' (was ${typeof value})`;
|
|
101
136
|
export const parseNarrowTuple = (def, ctx) => {
|
|
102
137
|
if (typeof def[2] !== "function") {
|
|
103
138
|
return throwParseError(writeMalformedFunctionalExpressionMessage(":", def[2]));
|
|
104
139
|
}
|
|
105
|
-
return ctx.
|
|
106
|
-
.parse(def[0], ctx)
|
|
107
|
-
.constrain("predicate", def[2]);
|
|
108
|
-
};
|
|
109
|
-
const parseAttributeTuple = (def, ctx) => {
|
|
110
|
-
return ctx.scope.parse(def[0], ctx);
|
|
140
|
+
return ctx.$.parse(def[0], ctx).constrain("predicate", def[2]);
|
|
111
141
|
};
|
|
142
|
+
const parseAttributeTuple = (def, ctx) => ctx.$.parse(def[0], ctx).configureShallowDescendants(def[2]);
|
|
112
143
|
const indexOneParsers = {
|
|
113
144
|
"|": parseBranchTuple,
|
|
114
145
|
"&": parseBranchTuple,
|
|
@@ -119,19 +150,20 @@ const indexOneParsers = {
|
|
|
119
150
|
};
|
|
120
151
|
const prefixParsers = {
|
|
121
152
|
keyof: parseKeyOfTuple,
|
|
122
|
-
instanceof: (def) => {
|
|
153
|
+
instanceof: (def, ctx) => {
|
|
123
154
|
if (typeof def[1] !== "function") {
|
|
124
155
|
return throwParseError(writeInvalidConstructorMessage(objectKindOrDomainOf(def[1])));
|
|
125
156
|
}
|
|
126
157
|
const branches = def
|
|
127
158
|
.slice(1)
|
|
128
|
-
.map(
|
|
129
|
-
|
|
159
|
+
.map(ctor => typeof ctor === "function" ?
|
|
160
|
+
ctx.$.node("proto", { proto: ctor })
|
|
130
161
|
: throwParseError(writeInvalidConstructorMessage(objectKindOrDomainOf(ctor))));
|
|
131
|
-
return
|
|
162
|
+
return branches.length === 1 ?
|
|
163
|
+
branches[0]
|
|
164
|
+
: ctx.$.node("union", { branches });
|
|
132
165
|
},
|
|
133
|
-
"===": (def) =>
|
|
166
|
+
"===": (def, ctx) => ctx.$.units(def.slice(1))
|
|
134
167
|
};
|
|
135
168
|
const isIndexZeroExpression = (def) => prefixParsers[def[0]] !== undefined;
|
|
136
169
|
export const writeInvalidConstructorMessage = (actual) => `Expected a constructor following 'instanceof' operator (was ${actual})`;
|
|
137
|
-
//# sourceMappingURL=tuple.js.map
|
package/out/parser/tuple.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tuple.js","sourceRoot":"","sources":["../../parser/tuple.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"tuple.js","sourceRoot":"","sources":["../../parser/tuple.ts"],"names":[],"mappings":"AAAA,OAAO,EAeN,SAAS,EACT,iCAAiC,EACjC,UAAU,EACV,MAAM,iBAAiB,CAAA;AACxB,OAAO,EAKN,MAAM,EAGN,oBAAoB,EAEpB,eAAe,EACf,MAAM,eAAe,CAAA;AAItB,OAAO,EAAE,+BAA+B,EAAE,MAAM,sCAAsC,CAAA;AAGtF,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,GAAU,EAAE,GAAiB,EAAa,EAAE,CACtE,yBAAyB,CAAC,GAAG,EAAE,GAAG,CAAC,IAAI,iBAAiB,CAAC,GAAG,EAAE,GAAG,CAAC,CAAA;AAEnE,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,GAAU,EAAE,GAAiB,EAAa,EAAE;IAC7E,IAAI,SAAS,GAA+B,CAAC,EAAE,CAAC,CAAA;IAChD,IAAI,CAAC,GAAG,CAAC,CAAA;IACT,OAAO,CAAC,GAAG,GAAG,CAAC,MAAM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