arktype 2.0.0-rc.0 → 2.0.0-rc.2
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/out/generic.d.ts +12 -7
- package/out/generic.js +3 -3
- package/out/index.d.ts +2 -2
- package/out/index.js +1 -0
- package/out/keywords/ark.d.ts +13 -7
- package/out/keywords/ark.js +11 -5
- package/out/keywords/{builtin.d.ts → builtins.d.ts} +9 -5
- package/out/keywords/{builtin.js → builtins.js} +1 -1
- package/out/keywords/constructors/Array.d.ts +11 -7
- package/out/keywords/constructors/Array.js +1 -1
- package/out/keywords/constructors/FormData.d.ts +12 -6
- package/out/keywords/constructors/FormData.js +15 -2
- package/out/keywords/constructors/TypedArray.d.ts +18 -14
- package/out/keywords/constructors/constructors.d.ts +21 -31
- package/out/keywords/constructors/constructors.js +11 -26
- package/out/keywords/number/number.d.ts +5 -3
- package/out/keywords/string/capitalize.d.ts +10 -9
- package/out/keywords/string/date.d.ts +30 -25
- package/out/keywords/string/date.js +1 -1
- package/out/keywords/string/integer.d.ts +10 -9
- package/out/keywords/string/ip.d.ts +11 -11
- package/out/keywords/string/json.d.ts +10 -9
- package/out/keywords/string/lower.d.ts +10 -9
- package/out/keywords/string/normalize.d.ts +49 -29
- package/out/keywords/string/numeric.d.ts +10 -9
- package/out/keywords/string/string.d.ts +73 -18
- package/out/keywords/string/string.js +2 -2
- package/out/keywords/string/trim.d.ts +10 -9
- package/out/keywords/string/upper.d.ts +10 -9
- package/out/keywords/string/url.d.ts +10 -9
- package/out/keywords/string/uuid.d.ts +17 -13
- package/out/keywords/ts.d.ts +33 -22
- package/out/keywords/ts.js +15 -13
- package/out/parser/definition.d.ts +2 -4
- package/out/parser/objectLiteral.d.ts +13 -1
- package/out/parser/semantic/bounds.d.ts +3 -1
- package/out/parser/semantic/default.d.ts +3 -2
- package/out/parser/semantic/infer.d.ts +20 -14
- package/out/parser/semantic/utils.d.ts +2 -2
- package/out/parser/semantic/validate.d.ts +5 -8
- package/out/parser/string/shift/operand/enclosed.d.ts +3 -1
- package/out/parser/string/shift/operand/unenclosed.d.ts +6 -7
- package/out/parser/string/shift/operator/bounds.d.ts +6 -5
- package/out/parser/string/shift/operator/operator.js +2 -2
- package/out/parser/string/shift/scanner.d.ts +3 -1
- package/out/parser/string/shift/scanner.js +2 -2
- package/out/parser/string/string.d.ts +3 -2
- package/out/scope.d.ts +18 -4
- package/out/scope.js +15 -2
- package/out/subtypes/base.d.ts +2 -1
- package/out/type.d.ts +5 -2
- package/out/type.js +12 -6
- package/package.json +3 -3
|
@@ -1,25 +1,32 @@
|
|
|
1
1
|
import type { GenericAst } from "@ark/schema";
|
|
2
|
-
import type {
|
|
3
|
-
import type { ArkAmbient } from "../../config.ts";
|
|
2
|
+
import type { Hkt, array } from "@ark/util";
|
|
4
3
|
import type { inferIntersection } from "../../intersect.ts";
|
|
5
|
-
import type { Date,
|
|
6
|
-
import type {
|
|
7
|
-
import type {
|
|
4
|
+
import type { Date, Default, LimitLiteral, applyConstraint, distillIn, distillOut, normalizeLimit } from "../../keywords/ast.ts";
|
|
5
|
+
import type { UnparsedScope } from "../../scope.ts";
|
|
6
|
+
import type { inferAmbient } from "../../type.ts";
|
|
8
7
|
import type { inferDefinition } from "../definition.ts";
|
|
9
8
|
import type { Comparator, MinComparator } from "../string/reduce/shared.ts";
|
|
10
|
-
|
|
11
|
-
export type inferAstRoot<ast, $, args> = inferConstrainableAst<ast, $, args>;
|
|
9
|
+
export type inferAstRoot<ast, $, args> = ast extends array ? inferExpression<ast, $, args> : never;
|
|
12
10
|
export type inferAstIn<ast, $, args> = distillIn<inferAstRoot<ast, $, args>>;
|
|
13
11
|
export type inferAstOut<ast, $, args> = distillOut<inferAstRoot<ast, $, args>>;
|
|
14
|
-
export type
|
|
12
|
+
export type DefAst<def = unknown, alias extends string = string> = [
|
|
13
|
+
def,
|
|
14
|
+
"def",
|
|
15
|
+
alias
|
|
16
|
+
];
|
|
17
|
+
export type InferredAst<t = unknown, def extends string = string> = [
|
|
18
|
+
t,
|
|
19
|
+
"inferred",
|
|
20
|
+
def
|
|
21
|
+
];
|
|
15
22
|
export type GenericInstantiationAst<generic extends GenericAst = GenericAst, argAsts extends unknown[] = unknown[]> = [generic, "<>", argAsts];
|
|
16
23
|
type resolveScope<g$, $> = g$ extends UnparsedScope ? $ : g$;
|
|
17
|
-
export type inferExpression<ast extends array, $, args>
|
|
18
|
-
[i in keyof argAsts]:
|
|
24
|
+
export type inferExpression<ast, $, args> = ast extends array ? ast extends InferredAst<infer resolution> ? resolution : ast extends DefAst<infer def> ? inferDefinition<def, $, args> : ast extends GenericInstantiationAst<infer g, infer argAsts> ? g["bodyDef"] extends Hkt ? Hkt.apply<g["bodyDef"], {
|
|
25
|
+
[i in keyof argAsts]: inferExpression<argAsts[i], $, args>;
|
|
19
26
|
}> : inferDefinition<g["bodyDef"], resolveScope<g["$"], $>, {
|
|
20
|
-
[i in keyof g["names"] & `${number}` as g["names"][i]]:
|
|
21
|
-
}> : ast[1] extends "[]" ?
|
|
22
|
-
export type constrainBound<constrainableIn, comparator extends Comparator, limit> = distillIn<constrainableIn> extends infer In ? comparator extends "==" ? In extends number ? limit : In extends Date ? Date.literal<normalizeLimit<limit>> : applyConstraint<constrainableIn, "exactLength", limit & number> : applyConstraint<constrainableIn, In extends number ? comparator extends MinComparator ? "min" : "max" : In extends string | array ? comparator extends MinComparator ? "minLength" : "maxLength" : comparator extends MinComparator ? "after" : "before", {
|
|
27
|
+
[i in keyof g["names"] & `${number}` as g["names"][i]]: inferExpression<argAsts[i & keyof argAsts], resolveScope<g["arg$"], $>, args>;
|
|
28
|
+
}> : ast[1] extends "[]" ? inferExpression<ast[0], $, args>[] : ast[1] extends "|" ? inferExpression<ast[0], $, args> | inferExpression<ast[2], $, args> : ast[1] extends "&" ? inferIntersection<inferExpression<ast[0], $, args>, inferExpression<ast[2], $, args>> : ast[1] extends "=" ? inferAmbient<ast[2]> extends infer defaultValue ? (In?: inferExpression<ast[0], $, args>) => Default<defaultValue> : never : ast[1] extends Comparator ? ast[0] extends LimitLiteral ? constrainBound<inferExpression<ast[2], $, args>, ast[1], ast[0]> : constrainBound<inferExpression<ast[0], $, args>, ast[1], ast[2] & LimitLiteral> : ast[1] extends "%" ? applyConstraint<inferExpression<ast[0], $, args>, "divisor", ast[2] & number> : ast[0] extends "keyof" ? keyof inferExpression<ast[1], $, args> : never : never;
|
|
29
|
+
export type constrainBound<constrainableIn, comparator extends Comparator, limit extends LimitLiteral> = distillIn<constrainableIn> extends infer In ? comparator extends "==" ? In extends number ? limit : In extends Date ? Date.literal<normalizeLimit<limit>> : applyConstraint<constrainableIn, "exactLength", limit & number> : applyConstraint<constrainableIn, In extends number ? comparator extends MinComparator ? "min" : "max" : In extends string | array ? comparator extends MinComparator ? "minLength" : "maxLength" : comparator extends MinComparator ? "after" : "before", {
|
|
23
30
|
rule: normalizeLimit<limit>;
|
|
24
31
|
exclusive: comparator extends ">" | "<" ? true : false;
|
|
25
32
|
}> : never;
|
|
@@ -29,5 +36,4 @@ export type PostfixOperator = "[]";
|
|
|
29
36
|
export type PostfixExpression<operator extends PostfixOperator = PostfixOperator, operand = unknown> = readonly [operand, operator];
|
|
30
37
|
export type InfixOperator = "|" | "&" | Comparator | "%" | ":" | "=>" | "@";
|
|
31
38
|
export type InfixExpression<operator extends InfixOperator = InfixOperator, l = unknown, r = unknown> = [l, operator, r];
|
|
32
|
-
export type inferTerminal<token extends string, $, args> = token extends keyof args | keyof $ ? resolve<token, $, args> : token extends keyof ArkAmbient.$ ? resolve<token, ArkAmbient.$, args> : `#${token}` extends keyof $ ? resolve<`#${token}`, $, args> : token extends StringLiteral<infer text> ? text : token extends `${infer n extends number}` ? n : token extends BigintLiteral<infer b> ? b : token extends RegexLiteral<infer source> ? string.matching<source> : token extends DateLiteral<infer source> ? Date.literal<source> : tryInferSubmoduleReference<$, token>;
|
|
33
39
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { Stringifiable } from "@ark/util";
|
|
2
2
|
import type { Comparator } from "../string/reduce/shared.ts";
|
|
3
|
-
import type { InfixExpression, PostfixExpression } from "./infer.ts";
|
|
4
|
-
export type astToString<ast> = ast extends PostfixExpression<infer operator, infer operand> ? operator extends "[]" ? `${astToString<operand>}[]` : never : ast extends InfixExpression<infer operator, infer l, infer r> ? operator extends "&" | "|" | "%" | Comparator ? `${astToString<l>} ${operator} ${astToString<r>}` : never : ast extends Stringifiable ? `${ast extends bigint ? `${ast}n` : ast}` : "...";
|
|
3
|
+
import type { DefAst, InferredAst, InfixExpression, PostfixExpression } from "./infer.ts";
|
|
4
|
+
export type astToString<ast> = ast extends InferredAst | DefAst ? ast[2] : ast extends PostfixExpression<infer operator, infer operand> ? operator extends "[]" ? `${astToString<operand>}[]` : never : ast extends InfixExpression<infer operator, infer l, infer r> ? operator extends "&" | "|" | "%" | Comparator ? `${astToString<l>} ${operator} ${astToString<r>}` : never : ast extends Stringifiable ? `${ast extends bigint ? `${ast}n` : ast}` : "...";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { arkKind, GenericParamAst, PrivateDeclaration, writeMissingSubmoduleAccessMessage, writeUnsatisfiedParameterConstraintMessage } from "@ark/schema";
|
|
2
|
-
import type { anyOrNever, array, BigintLiteral, charsAfterFirst, Completion, ErrorMessage, typeToString, writeMalformedNumericLiteralMessage } from "@ark/util";
|
|
2
|
+
import type { anyOrNever, array, BigintLiteral, charsAfterFirst, Completion, ErrorMessage, NumberLiteral, typeToString, writeMalformedNumericLiteralMessage } from "@ark/util";
|
|
3
3
|
import type { Generic } from "../../generic.ts";
|
|
4
4
|
import type { Comparator } from "../string/reduce/shared.ts";
|
|
5
5
|
import type { writeInvalidGenericArgCountMessage } from "../string/shift/operand/genericArgs.ts";
|
|
@@ -8,22 +8,19 @@ import type { parseString } from "../string/string.ts";
|
|
|
8
8
|
import type { validateRange } from "./bounds.ts";
|
|
9
9
|
import type { validateDefault } from "./default.ts";
|
|
10
10
|
import type { validateDivisor } from "./divisor.ts";
|
|
11
|
-
import type { GenericInstantiationAst, inferAstRoot, InfixExpression, PostfixExpression } from "./infer.ts";
|
|
11
|
+
import type { DefAst, GenericInstantiationAst, inferAstRoot, InferredAst, InfixExpression, PostfixExpression } from "./infer.ts";
|
|
12
12
|
import type { validateKeyof } from "./keyof.ts";
|
|
13
13
|
import type { astToString } from "./utils.ts";
|
|
14
|
-
export type validateAst<ast, $, args> = ast extends
|
|
14
|
+
export type validateAst<ast, $, args> = ast extends ErrorMessage ? ast : ast extends InferredAst ? validateInferredAst<ast[0], ast[2]> : ast extends DefAst ? ast[2] extends PrivateDeclaration ? ErrorMessage<writePrefixedPrivateReferenceMessage<ast[2]>> : undefined : ast extends PostfixExpression<infer operator, infer operand> ? operator extends "[]" ? validateAst<operand, $, args> : never : ast extends InfixExpression<infer operator, infer l, infer r> ? operator extends "&" | "|" ? validateInfix<ast, $, args> : operator extends Comparator ? validateRange<l, operator, r, $, args> : operator extends "%" ? validateDivisor<l, $, args> : undefined : ast extends [infer baseAst, "=", infer unitLiteral extends UnitLiteral] ? validateDefault<baseAst, unitLiteral, $, args> : ast extends ["keyof", infer operand] ? validateKeyof<operand, $, args> : ast extends GenericInstantiationAst<infer g, infer argAsts> ? validateGenericArgs<g["paramsAst"], argAsts, $, args, []> : ErrorMessage<writeUnexpectedExpressionMessage<astToString<ast>>> & {
|
|
15
15
|
ast: ast;
|
|
16
16
|
};
|
|
17
17
|
type writeUnexpectedExpressionMessage<expression extends string> = `Unexpectedly failed to parse the expression resulting from ${expression}`;
|
|
18
18
|
type validateGenericArgs<params extends array<GenericParamAst>, argAsts extends array, $, args, indices extends 1[]> = argAsts extends readonly [infer arg, ...infer argsTail] ? validateAst<arg, $, args> extends infer e extends ErrorMessage ? e : inferAstRoot<arg, $, args> extends params[indices["length"]][1] ? validateGenericArgs<params, argsTail, $, args, [...indices, 1]> : ErrorMessage<writeUnsatisfiedParameterConstraintMessage<params[indices["length"]][0], typeToString<params[indices["length"]][1]>, astToString<arg>>> : undefined;
|
|
19
19
|
export declare const writePrefixedPrivateReferenceMessage: <def extends PrivateDeclaration>(def: def) => writePrefixedPrivateReferenceMessage<def>;
|
|
20
20
|
export type writePrefixedPrivateReferenceMessage<def extends PrivateDeclaration> = `Private type references should not include '#'. Use '${charsAfterFirst<def>}' instead.`;
|
|
21
|
-
type
|
|
22
|
-
$[alias]
|
|
23
|
-
] extends [anyOrNever] ? def : def extends PrivateDeclaration ? ErrorMessage<writePrefixedPrivateReferenceMessage<def>> : $[alias] extends Generic ? ErrorMessage<writeInvalidGenericArgCountMessage<def, $[alias]["names"], []>> : $[alias] extends {
|
|
21
|
+
type validateInferredAst<inferred, def extends string> = def extends NumberLiteral ? number extends inferred ? ErrorMessage<writeMalformedNumericLiteralMessage<def, "number">> : undefined : def extends BigintLiteral ? bigint extends inferred ? ErrorMessage<writeMalformedNumericLiteralMessage<def, "bigint">> : undefined : [inferred] extends [anyOrNever] ? undefined : def extends PrivateDeclaration ? ErrorMessage<writePrefixedPrivateReferenceMessage<def>> : inferred extends Generic ? ErrorMessage<writeInvalidGenericArgCountMessage<def, inferred["names"], []>> : inferred extends {
|
|
24
22
|
[arkKind]: "module";
|
|
25
|
-
} ? "$root" extends keyof
|
|
26
|
-
export type maybeExtractAlias<def extends string, $> = def extends keyof $ ? def : `#${def}` extends keyof $ ? `#${def}` : null;
|
|
23
|
+
} ? "$root" extends keyof inferred ? undefined : ErrorMessage<writeMissingSubmoduleAccessMessage<def>> : def extends ErrorMessage ? def : undefined;
|
|
27
24
|
export type validateString<def extends string, $, args> = validateAst<parseString<def, $, args>, $, args> extends (infer result extends ErrorMessage) ? result extends Completion<infer text> ? text : result : def;
|
|
28
25
|
type validateInfix<ast extends InfixExpression, $, args> = validateAst<ast[0], $, args> extends infer e extends ErrorMessage ? e : validateAst<ast[2], $, args> extends infer e extends ErrorMessage ? e : undefined;
|
|
29
26
|
export {};
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { Date, string } from "../../../../keywords/ast.ts";
|
|
2
|
+
import type { InferredAst } from "../../../semantic/infer.ts";
|
|
1
3
|
import type { DynamicState } from "../../reduce/dynamic.ts";
|
|
2
4
|
import type { StaticState, state } from "../../reduce/static.ts";
|
|
3
5
|
import type { Scanner } from "../scanner.ts";
|
|
@@ -5,7 +7,7 @@ export type StringLiteral<Text extends string = string> = DoubleQuotedStringLite
|
|
|
5
7
|
export type DoubleQuotedStringLiteral<Text extends string = string> = `"${Text}"`;
|
|
6
8
|
export type SingleQuotedStringLiteral<Text extends string = string> = `'${Text}'`;
|
|
7
9
|
export declare const parseEnclosed: (s: DynamicState, enclosing: EnclosingStartToken) => void;
|
|
8
|
-
export type parseEnclosed<s extends StaticState, enclosingStart extends EnclosingStartToken, unscanned extends string> = Scanner.shiftUntil<unscanned, EnclosingTokens[enclosingStart]> extends (Scanner.shiftResult<infer scanned, infer nextUnscanned>) ? nextUnscanned extends "" ? state.error<writeUnterminatedEnclosedMessage<scanned, enclosingStart>> : state.setRoot<s, `${enclosingStart}${scanned}${EnclosingTokens[enclosingStart]}
|
|
10
|
+
export type parseEnclosed<s extends StaticState, enclosingStart extends EnclosingStartToken, unscanned extends string> = Scanner.shiftUntil<unscanned, EnclosingTokens[enclosingStart]> extends (Scanner.shiftResult<infer scanned, infer nextUnscanned>) ? nextUnscanned extends "" ? state.error<writeUnterminatedEnclosedMessage<scanned, enclosingStart>> : state.setRoot<s, InferredAst<enclosingStart extends EnclosingQuote ? scanned : enclosingStart extends "/" ? string.matching<scanned> : Date.literal<scanned>, `${enclosingStart}${scanned}${EnclosingTokens[enclosingStart]}`>, nextUnscanned extends Scanner.shift<string, infer unscanned> ? unscanned : ""> : never;
|
|
9
11
|
export declare const enclosingQuote: {
|
|
10
12
|
readonly "'": 1;
|
|
11
13
|
readonly '"': 1;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { writeUnresolvableMessage, type BaseRoot, type GenericAst, type GenericRoot, type arkKind, type genericParamNames, type resolvableReferenceIn, type writeNonSubmoduleDotMessage } from "@ark/schema";
|
|
2
|
-
import { type BigintLiteral, type
|
|
2
|
+
import { type BigintLiteral, type NumberLiteral, type join, type lastOf } from "@ark/util";
|
|
3
3
|
import type { ArkAmbient } from "../../../../config.ts";
|
|
4
|
-
import type {
|
|
4
|
+
import type { resolutionToAst } from "../../../../scope.ts";
|
|
5
|
+
import type { GenericInstantiationAst, InferredAst } from "../../../semantic/infer.ts";
|
|
5
6
|
import type { DynamicState } from "../../reduce/dynamic.ts";
|
|
6
7
|
import type { StaticState, state } from "../../reduce/static.ts";
|
|
7
8
|
import type { BaseCompletions } from "../../string.ts";
|
|
@@ -9,17 +10,15 @@ import type { Scanner } from "../scanner.ts";
|
|
|
9
10
|
import { parseGenericArgs, writeInvalidGenericArgCountMessage, type ParsedArgs } from "./genericArgs.ts";
|
|
10
11
|
export declare const parseUnenclosed: (s: DynamicState) => void;
|
|
11
12
|
export type parseUnenclosed<s extends StaticState, $, args> = Scanner.shiftUntilNextTerminator<s["unscanned"]> extends (Scanner.shiftResult<infer token, infer unscanned>) ? tryResolve<s, unscanned, token, $, args> extends state.from<infer s> ? s : never : never;
|
|
12
|
-
type parseResolution<s extends StaticState, unscanned extends string, alias extends string, resolution, $, args> =
|
|
13
|
-
resolution
|
|
14
|
-
] extends [anyOrNever] ? state.setRoot<s, alias, unscanned> : resolution extends GenericAst ? parseGenericInstantiation<alias, resolution, state.scanTo<s, unscanned>, $, args> : state.setRoot<s, alias, unscanned>;
|
|
13
|
+
type parseResolution<s extends StaticState, unscanned extends string, alias extends string, resolution, $, args> = resolutionToAst<alias, resolution> extends infer ast ? ast extends GenericAst ? parseGenericInstantiation<alias, ast, state.scanTo<s, unscanned>, $, args> : state.setRoot<s, ast, unscanned> : never;
|
|
15
14
|
export declare const parseGenericInstantiation: (name: string, g: GenericRoot, s: DynamicState) => BaseRoot;
|
|
16
15
|
export type parseGenericInstantiation<name extends string, g extends GenericAst, s extends StaticState, $, args> = Scanner.skipWhitespace<s["unscanned"]> extends `<${infer unscanned}` ? parseGenericArgs<name, g, unscanned, $, args> extends infer result ? result extends ParsedArgs<infer argAsts, infer nextUnscanned> ? state.setRoot<s, GenericInstantiationAst<g, argAsts>, nextUnscanned> : result : never : state.error<writeInvalidGenericArgCountMessage<name, genericParamNames<g["paramsAst"]>, [
|
|
17
16
|
]>>;
|
|
18
|
-
type tryResolve<s extends StaticState, unscanned extends string, token extends string, $, args> = token extends keyof args ? parseResolution<s, unscanned, token, args[token], $, args> : token extends keyof $ ? parseResolution<s, unscanned, token, $[token], $, args> : `#${token}` extends keyof $ ? parseResolution<s, unscanned, token, $[`#${token}`], $, args> : token extends keyof ArkAmbient.$ ? parseResolution<s, unscanned, token, ArkAmbient.$[token], $, args> : token extends
|
|
17
|
+
type tryResolve<s extends StaticState, unscanned extends string, token extends string, $, args> = token extends keyof args ? parseResolution<s, unscanned, token, args[token], $, args> : token extends keyof $ ? parseResolution<s, unscanned, token, $[token], $, args> : `#${token}` extends keyof $ ? parseResolution<s, unscanned, token, $[`#${token}`], $, args> : token extends keyof ArkAmbient.$ ? parseResolution<s, unscanned, token, ArkAmbient.$[token], $, args> : token extends NumberLiteral<infer n> ? state.setRoot<s, InferredAst<n, token>, unscanned> : token extends (`${infer submodule extends keyof $ & string}.${infer reference}`) ? tryResolveSubmodule<token, $[submodule], reference, s, unscanned, $, args, [
|
|
19
18
|
submodule
|
|
20
19
|
]> : token extends (`${infer submodule extends keyof ArkAmbient.$ & string}.${infer reference}`) ? tryResolveSubmodule<token, ArkAmbient.$[submodule], reference, s, unscanned, $, args, [
|
|
21
20
|
submodule
|
|
22
|
-
]> : token extends BigintLiteral ? state.setRoot<s,
|
|
21
|
+
]> : token extends BigintLiteral<infer b> ? state.setRoot<s, InferredAst<b, token>, unscanned> : token extends "keyof" ? state.addPrefix<s, "keyof", unscanned> : unresolvableState<s, token, $, args, []>;
|
|
23
22
|
type tryResolveSubmodule<token extends string, resolution, reference extends string, s extends StaticState, unscanned extends string, $, args, submodulePath extends string[]> = resolution extends {
|
|
24
23
|
[arkKind]: "module";
|
|
25
24
|
} ? reference extends keyof resolution ? parseResolution<s, unscanned, token, resolution[reference], $, args> : reference extends (`${infer nestedSubmodule extends keyof resolution & string}.${infer nestedReference}`) ? tryResolveSubmodule<token, resolution[nestedSubmodule], nestedReference, s, unscanned, $, args, [
|
|
@@ -1,23 +1,24 @@
|
|
|
1
1
|
import { type BaseRoot, type BoundKind } from "@ark/schema";
|
|
2
2
|
import { type keySet } from "@ark/util";
|
|
3
|
-
import type {
|
|
3
|
+
import type { DateLiteral } from "../../../../keywords/ast.ts";
|
|
4
|
+
import type { InferredAst } from "../../../semantic/infer.ts";
|
|
4
5
|
import type { astToString } from "../../../semantic/utils.ts";
|
|
5
6
|
import type { DynamicState, DynamicStateWithRoot } from "../../reduce/dynamic.ts";
|
|
6
7
|
import { writeUnpairableComparatorMessage, type Comparator, type InvertedComparators, type MaxComparator } from "../../reduce/shared.ts";
|
|
7
|
-
import type {
|
|
8
|
+
import type { state, StaticState } from "../../reduce/static.ts";
|
|
8
9
|
import type { parseOperand } from "../operand/operand.ts";
|
|
9
10
|
import type { Scanner } from "../scanner.ts";
|
|
10
11
|
export declare const parseBound: (s: DynamicStateWithRoot, start: ComparatorStartChar) => void;
|
|
11
|
-
export type parseBound<s extends StaticState, start extends ComparatorStartChar, unscanned extends string, $, args> = shiftComparator<start, unscanned> extends infer shiftResultOrError ? shiftResultOrError extends (Scanner.shiftResult<infer comparator extends Comparator, infer nextUnscanned>) ? s["root"] extends `${infer limit extends
|
|
12
|
+
export type parseBound<s extends StaticState, start extends ComparatorStartChar, unscanned extends string, $, args> = shiftComparator<start, unscanned> extends infer shiftResultOrError ? shiftResultOrError extends (Scanner.shiftResult<infer comparator extends Comparator, infer nextUnscanned>) ? s["root"] extends (InferredAst<Date | number, `${infer limit extends number | DateLiteral}`>) ? state.reduceLeftBound<s, limit, comparator, nextUnscanned> : parseRightBound<state.scanTo<s, nextUnscanned>, comparator, $, args> : shiftResultOrError : never;
|
|
12
13
|
type OneCharComparator = ">" | "<";
|
|
13
14
|
export type ComparatorStartChar = Comparator extends `${infer char}${string}` ? char : never;
|
|
14
15
|
export declare const comparatorStartChars: keySet<ComparatorStartChar>;
|
|
15
16
|
declare const shiftComparator: (s: DynamicState, start: ComparatorStartChar) => Comparator;
|
|
16
17
|
type shiftComparator<start extends ComparatorStartChar, unscanned extends string> = unscanned extends `=${infer nextUnscanned}` ? [`${start}=`, nextUnscanned] : [start & OneCharComparator, unscanned];
|
|
17
18
|
export declare const writeIncompatibleRangeMessage: (l: BoundKind, r: BoundKind) => string;
|
|
18
|
-
export declare const getBoundKinds: (comparator: Comparator, limit:
|
|
19
|
+
export declare const getBoundKinds: (comparator: Comparator, limit: number | DateLiteral, root: BaseRoot, boundKind: BoundExpressionKind) => BoundKind[];
|
|
19
20
|
export declare const parseRightBound: (s: DynamicStateWithRoot, comparator: Comparator) => void;
|
|
20
|
-
export type parseRightBound<s extends StaticState, comparator extends Comparator, $, args> = parseOperand<s, $, args> extends infer nextState extends StaticState ? nextState["root"] extends `${infer limit extends
|
|
21
|
+
export type parseRightBound<s extends StaticState, comparator extends Comparator, $, args> = parseOperand<s, $, args> extends infer nextState extends StaticState ? nextState["root"] extends (InferredAst<unknown, `${infer limit extends number | DateLiteral}`>) ? s["branches"]["leftBound"] extends {} ? comparator extends MaxComparator ? state.reduceRange<s, s["branches"]["leftBound"]["limit"], s["branches"]["leftBound"]["comparator"], comparator, limit, nextState["unscanned"]> : state.error<writeUnpairableComparatorMessage<comparator>> : state.reduceSingleBound<s, comparator, limit, nextState["unscanned"]> : state.error<writeInvalidLimitMessage<comparator, astToString<nextState["root"]>, "right">> : never;
|
|
21
22
|
export declare const writeInvalidLimitMessage: <comparator extends Comparator, limit extends string | number, boundKind extends BoundExpressionKind>(comparator: comparator, limit: limit, boundKind: boundKind) => writeInvalidLimitMessage<comparator, limit, boundKind>;
|
|
22
23
|
export type writeInvalidLimitMessage<comparator extends Comparator, limit extends string | number, boundKind extends BoundExpressionKind> = `Comparator ${boundKind extends "left" ? InvertedComparators[comparator] : comparator} must be ${boundKind extends "left" ? "preceded" : "followed"} by a corresponding literal (was ${limit})`;
|
|
23
24
|
export type BoundExpressionKind = "left" | "right";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isKeyOf } from "@ark/util";
|
|
1
|
+
import { isKeyOf, whiteSpaceTokens } from "@ark/util";
|
|
2
2
|
import { Scanner } from "../scanner.js";
|
|
3
3
|
import { comparatorStartChars, parseBound } from "./bounds.js";
|
|
4
4
|
import { parseDivisor } from "./divisor.js";
|
|
@@ -15,7 +15,7 @@ export const parseOperator = (s) => {
|
|
|
15
15
|
s.finalize(lookahead)
|
|
16
16
|
: isKeyOf(lookahead, comparatorStartChars) ? parseBound(s, lookahead)
|
|
17
17
|
: lookahead === "%" ? parseDivisor(s)
|
|
18
|
-
: lookahead
|
|
18
|
+
: lookahead in whiteSpaceTokens ? parseOperator(s)
|
|
19
19
|
: s.error(writeUnexpectedCharacterMessage(lookahead)));
|
|
20
20
|
};
|
|
21
21
|
export const writeUnexpectedCharacterMessage = (char, shouldBe = "") => `'${char}' is not allowed here${shouldBe && ` (should be ${shouldBe})`}`;
|
|
@@ -21,6 +21,9 @@ export declare class Scanner<lookahead extends string = string> {
|
|
|
21
21
|
lookaheadIs<char extends lookahead>(char: char): this is Scanner<char>;
|
|
22
22
|
lookaheadIsIn<tokens extends Dict>(tokens: tokens): this is Scanner<Extract<keyof tokens, string>>;
|
|
23
23
|
static terminatingChars: {
|
|
24
|
+
readonly " ": true;
|
|
25
|
+
readonly "\n": true;
|
|
26
|
+
readonly "\t": true;
|
|
24
27
|
readonly "<": true;
|
|
25
28
|
readonly ">": true;
|
|
26
29
|
readonly "=": true;
|
|
@@ -29,7 +32,6 @@ export declare class Scanner<lookahead extends string = string> {
|
|
|
29
32
|
readonly ")": true;
|
|
30
33
|
readonly "[": true;
|
|
31
34
|
readonly "%": true;
|
|
32
|
-
readonly " ": true;
|
|
33
35
|
readonly ",": true;
|
|
34
36
|
readonly ":": true;
|
|
35
37
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { BaseRoot, resolvableReferenceIn } from "@ark/schema";
|
|
2
2
|
import { type ErrorMessage } from "@ark/util";
|
|
3
3
|
import type { ArkAmbient } from "../../config.ts";
|
|
4
|
+
import type { resolutionToAst } from "../../scope.ts";
|
|
4
5
|
import type { inferAstRoot } from "../semantic/infer.ts";
|
|
5
6
|
import type { DynamicState, DynamicStateWithRoot } from "./reduce/dynamic.ts";
|
|
6
7
|
import type { StringifiablePrefixOperator } from "./reduce/shared.ts";
|
|
@@ -12,8 +13,8 @@ import { writeUnexpectedCharacterMessage, type parseOperator } from "./shift/ope
|
|
|
12
13
|
* Try to parse the definition from right to left using the most common syntax.
|
|
13
14
|
* This can be much more efficient for simple definitions.
|
|
14
15
|
*/
|
|
15
|
-
export type parseString<def extends string, $, args> = def extends keyof $ ? def : def extends `${infer child}[]` ? child extends keyof $ ? [
|
|
16
|
-
child,
|
|
16
|
+
export type parseString<def extends string, $, args> = def extends keyof $ ? resolutionToAst<def, $[def]> : def extends `${infer child}[]` ? child extends keyof $ ? [
|
|
17
|
+
resolutionToAst<child, $[child]>,
|
|
17
18
|
"[]"
|
|
18
19
|
] : fullStringParse<state.initialize<def>, $, args> : fullStringParse<state.initialize<def>, $, args>;
|
|
19
20
|
export type inferString<def extends string, $, args> = inferAstRoot<parseString<def, $, args>, $, args>;
|
package/out/scope.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { BaseScope, type AliasDefEntry, type ArkScopeConfig, type BaseNode, type BaseRoot, type GenericArgResolutions, type GenericAst, type GenericParamAst, type NodeKind, type NodeParseOptions, type NodeSchema, type PreparsedNodeResolution, type PrivateDeclaration, type RootKind, type RootSchema, type arkKind, type exportedNameOf, type nodeOfKind, type reducibleKindOf, type toInternalScope, type writeDuplicateAliasError } from "@ark/schema";
|
|
2
2
|
import { type ErrorType, type Json, type anyOrNever, type array, type flattenListable, type inferred, type noSuggest, type nominal } from "@ark/util";
|
|
3
|
-
import type { ArkAmbient } from "./config.ts";
|
|
3
|
+
import type { ArkAmbient, ArkSchemaRegistry } from "./config.ts";
|
|
4
4
|
import { parseGenericParams, type GenericDeclaration, type GenericParser, type ParameterString, type baseGenericConstraints, type parseValidGenericParams } from "./generic.ts";
|
|
5
|
-
import type { type } from "./keywords/ark.ts";
|
|
5
|
+
import type { Ark, type } from "./keywords/ark.ts";
|
|
6
6
|
import type { BoundModule, Module, Submodule, instantiateExport } from "./module.ts";
|
|
7
7
|
import { type inferDefinition, type validateDefinition } from "./parser/definition.ts";
|
|
8
|
+
import type { DefAst, InferredAst } from "./parser/semantic/infer.ts";
|
|
8
9
|
import type { ParsedDefault } from "./parser/string/shift/operator/default.ts";
|
|
9
10
|
import { InternalTypeParser, type DeclarationParser, type DefinitionParser, type Type, type TypeParser } from "./type.ts";
|
|
10
11
|
export type ScopeParser = <const def>(def: validateScope<def>, config?: ArkScopeConfig) => Scope<inferScope<def>>;
|
|
@@ -39,11 +40,18 @@ type inferBootstrapped<$> = {
|
|
|
39
40
|
export type bindGenericToScope<g extends GenericAst, $> = GenericAst<g["paramsAst"], g["bodyDef"], g["$"] extends UnparsedScope ? $ : g["$"], $>;
|
|
40
41
|
type extractGenericName<k> = k extends GenericDeclaration<infer name> ? name : never;
|
|
41
42
|
type extractGenericParameters<k> = k extends `${string}<${infer params}>` ? ParameterString<params> : never;
|
|
42
|
-
export type resolve<reference extends keyof $ | keyof args, $, args> =
|
|
43
|
+
export type resolve<reference extends keyof $ | keyof args, $, args> = inferResolution<reference extends keyof args ? args[reference] : $[reference & keyof $], $, args>;
|
|
44
|
+
export type resolutionToAst<alias extends string, resolution> = [
|
|
45
|
+
resolution
|
|
46
|
+
] extends [anyOrNever] ? InferredAst<resolution, alias> : resolution extends Def<infer def> ? DefAst<def, alias> : resolution extends {
|
|
47
|
+
[arkKind]: "module";
|
|
48
|
+
$root: infer root;
|
|
49
|
+
} ? InferredAst<root, alias> : resolution extends GenericAst ? resolution : InferredAst<resolution, alias>;
|
|
50
|
+
export type inferResolution<resolution, $, args> = [
|
|
43
51
|
resolution
|
|
44
52
|
] extends [anyOrNever] ? resolution : resolution extends {
|
|
45
53
|
[inferred]: infer t;
|
|
46
|
-
} ? t : resolution extends Def<infer def> ? inferDefinition<def, $, args> : resolution
|
|
54
|
+
} ? t : resolution extends Def<infer def> ? inferDefinition<def, $, args> : resolution;
|
|
47
55
|
export type moduleKeyOf<$> = {
|
|
48
56
|
[k in keyof $]: $[k] extends {
|
|
49
57
|
[arkKind]: "module";
|
|
@@ -53,6 +61,10 @@ export type moduleKeyOf<$> = {
|
|
|
53
61
|
}[keyof $];
|
|
54
62
|
type unwrapPreinferred<t> = t extends type.cast<infer inferred> ? inferred : t;
|
|
55
63
|
export type tryInferSubmoduleReference<$, token> = token extends `${infer submodule extends moduleKeyOf<$>}.${infer subalias}` ? subalias extends keyof $[submodule] ? unwrapPreinferred<$[submodule][subalias]> : tryInferSubmoduleReference<$[submodule], subalias> : token extends (`${infer submodule extends moduleKeyOf<ArkAmbient.$>}.${infer subalias}`) ? subalias extends keyof ArkAmbient.$[submodule] ? unwrapPreinferred<ArkAmbient.$[submodule][subalias]> : tryInferSubmoduleReference<ArkAmbient.$[submodule], subalias> : never;
|
|
64
|
+
export interface ArkTypeRegistry extends ArkSchemaRegistry {
|
|
65
|
+
typeAttachments?: Ark.boundTypeAttachments<any>;
|
|
66
|
+
}
|
|
67
|
+
export declare const $arkTypeRegistry: ArkTypeRegistry;
|
|
56
68
|
export interface ParseContext extends TypeParseOptions {
|
|
57
69
|
$: InternalScope;
|
|
58
70
|
}
|
|
@@ -65,7 +77,9 @@ export interface InternalScope {
|
|
|
65
77
|
export declare class InternalScope<$ extends {} = {}> extends BaseScope<$> {
|
|
66
78
|
private parseCache;
|
|
67
79
|
preparseAlias(k: string, v: unknown): AliasDefEntry;
|
|
80
|
+
protected cacheGetter<name extends keyof this>(name: name, value: this[name]): this[name];
|
|
68
81
|
preparseRoot(def: unknown): unknown;
|
|
82
|
+
get ambientAttachments(): Ark.boundTypeAttachments<$> | undefined;
|
|
69
83
|
parse<defaultable extends boolean = false>(def: unknown, ctx: ParseContext, defaultable?: defaultable): BaseRoot | (defaultable extends false ? never : ParsedDefault);
|
|
70
84
|
parseString<defaultable extends boolean>(def: string, ctx: ParseContext, defaultable: defaultable): BaseRoot | (defaultable extends false ? never : ParsedDefault);
|
|
71
85
|
parseRoot: (def: unknown, opts?: TypeParseOptions) => BaseRoot;
|
package/out/scope.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { BaseScope, hasArkKind, parseGeneric } from "@ark/schema";
|
|
2
|
-
import { domainOf, hasDomain, isThunk, throwParseError } from "@ark/util";
|
|
1
|
+
import { $ark, BaseScope, hasArkKind, parseGeneric } from "@ark/schema";
|
|
2
|
+
import { domainOf, flatMorph, hasDomain, isThunk, throwParseError } from "@ark/util";
|
|
3
3
|
import { parseGenericParams } from "./generic.js";
|
|
4
4
|
import { parseObject, writeBadDefinitionTypeMessage } from "./parser/definition.js";
|
|
5
5
|
import { DynamicState } from "./parser/string/reduce/dynamic.js";
|
|
@@ -7,6 +7,7 @@ import { writeUnexpectedCharacterMessage } from "./parser/string/shift/operator/
|
|
|
7
7
|
import { Scanner } from "./parser/string/shift/scanner.js";
|
|
8
8
|
import { fullStringParse } from "./parser/string/string.js";
|
|
9
9
|
import { InternalTypeParser } from "./type.js";
|
|
10
|
+
export const $arkTypeRegistry = $ark;
|
|
10
11
|
export class InternalScope extends BaseScope {
|
|
11
12
|
parseCache = {};
|
|
12
13
|
preparseAlias(k, v) {
|
|
@@ -32,11 +33,23 @@ export class InternalScope extends BaseScope {
|
|
|
32
33
|
}
|
|
33
34
|
];
|
|
34
35
|
}
|
|
36
|
+
cacheGetter(name, value) {
|
|
37
|
+
Object.defineProperty(this, name, { value });
|
|
38
|
+
return value;
|
|
39
|
+
}
|
|
35
40
|
preparseRoot(def) {
|
|
36
41
|
if (isThunk(def) && !hasArkKind(def, "generic"))
|
|
37
42
|
return def();
|
|
38
43
|
return def;
|
|
39
44
|
}
|
|
45
|
+
get ambientAttachments() {
|
|
46
|
+
if (!$arkTypeRegistry.typeAttachments)
|
|
47
|
+
return;
|
|
48
|
+
return this.cacheGetter("ambientAttachments", flatMorph($arkTypeRegistry.typeAttachments, (k, v) => [
|
|
49
|
+
k,
|
|
50
|
+
v.bindScope(this)
|
|
51
|
+
]));
|
|
52
|
+
}
|
|
40
53
|
parse(def, ctx, defaultable = false) {
|
|
41
54
|
if (typeof def === "string") {
|
|
42
55
|
if (ctx.args && Object.keys(ctx.args).some(k => def.includes(k))) {
|
package/out/subtypes/base.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ArkErrors, BaseRoot, Disjoint, JsonSchema, MetaSchema, Morph, UndeclaredKeyBehavior } from "@ark/schema";
|
|
2
|
-
import type { anyOrNever, Callable, ErrorMessage, inferred, Json, unset } from "@ark/util";
|
|
2
|
+
import type { anyOrNever, array, Callable, ErrorMessage, inferred, Json, unset } from "@ark/util";
|
|
3
3
|
import type { inferIntersection } from "../intersect.ts";
|
|
4
4
|
import type { distillConstrainableIn, distillConstrainableOut, distillIn, distillOut, distillValidatedOut, inferMorphOut, inferPipes } from "../keywords/ast.ts";
|
|
5
5
|
import type { Scope } from "../scope.ts";
|
|
@@ -42,6 +42,7 @@ interface Type<out t = unknown, $ = {}> extends Callable<(data: unknown) => dist
|
|
|
42
42
|
exclude<def>(r: validateTypeRoot<def, $>): instantiateType<Exclude<t, inferTypeRoot<def, $>>, $>;
|
|
43
43
|
extends<def>(other: validateTypeRoot<def, $>): this is instantiateType<inferTypeRoot<def, $>, $>;
|
|
44
44
|
overlaps<def>(r: validateTypeRoot<def, $>): boolean;
|
|
45
|
+
distribute<mapOut, reduceOut = mapOut[]>(mapBranch: (branch: Type, i: number, branches: array<Type>) => mapOut, reduceMapped?: (mappedBranches: mapOut[]) => reduceOut): reduceOut;
|
|
45
46
|
/** @deprecated */
|
|
46
47
|
apply: Function["apply"];
|
|
47
48
|
/** @deprecated */
|
package/out/type.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ArkErrors, BaseRoot, type MetaSchema, type Morph, type Predicate } from "@ark/schema";
|
|
2
2
|
import { Callable, type Constructor, type array, type conform } from "@ark/util";
|
|
3
|
-
import { type Generic, type ParameterString, type baseGenericConstraints, type parseValidGenericParams, type validateParameterString } from "./generic.ts";
|
|
3
|
+
import { type Generic, type GenericParser, type ParameterString, type baseGenericConstraints, type parseValidGenericParams, type validateParameterString } from "./generic.ts";
|
|
4
|
+
import type { Ark, ark } from "./keywords/ark.ts";
|
|
4
5
|
import type { distillIn, distillOut } from "./keywords/ast.ts";
|
|
5
6
|
import type { inferDefinition, validateDeclared, validateDefinition } from "./parser/definition.ts";
|
|
6
7
|
import type { IndexOneOperator, IndexZeroOperator, TupleInfixOperator } from "./parser/tuple.ts";
|
|
@@ -9,7 +10,7 @@ import type { BaseType } from "./subtypes/base.ts";
|
|
|
9
10
|
import type { instantiateType } from "./subtypes/instantiate.ts";
|
|
10
11
|
/** The convenience properties attached to `type` */
|
|
11
12
|
export type TypeParserAttachments = Omit<TypeParser, never>;
|
|
12
|
-
export interface TypeParser<$ = {}> {
|
|
13
|
+
export interface TypeParser<$ = {}> extends Ark.boundTypeAttachments<$> {
|
|
13
14
|
<const def, r = Type<inferTypeRoot<def, $>, $>>(def: validateTypeRoot<def, $>): r;
|
|
14
15
|
<params extends ParameterString, const def>(params: validateParameterString<params, $>, def: validateDefinition<def, $, baseGenericConstraints<parseValidGenericParams<params, $>>>): Generic<parseValidGenericParams<params, $>, def, $>;
|
|
15
16
|
<const zero, const one, const rest extends array, r = Type<inferTypeRoot<[zero, one, ...rest], $>, $>>(_0: zero extends IndexZeroOperator ? zero : validateTypeRoot<zero, $>, _1: zero extends "keyof" ? validateTypeRoot<one, $> : zero extends "instanceof" ? conform<one, Constructor> : zero extends "===" ? conform<one, unknown> : conform<one, IndexOneOperator>, ..._2: zero extends "===" ? rest : zero extends "instanceof" ? conform<rest, readonly Constructor[]> : one extends TupleInfixOperator ? one extends ":" ? [Predicate<distillIn<inferTypeRoot<zero, $>>>] : one extends "=>" ? [Morph<distillOut<inferTypeRoot<zero, $>>, unknown>] : one extends "@" ? [MetaSchema] : [validateTypeRoot<rest[0], $>] : []): r;
|
|
@@ -17,6 +18,8 @@ export interface TypeParser<$ = {}> {
|
|
|
17
18
|
errors: typeof ArkErrors;
|
|
18
19
|
module: ModuleParser;
|
|
19
20
|
scope: ScopeParser;
|
|
21
|
+
generic: GenericParser<$>;
|
|
22
|
+
ark: typeof ark;
|
|
20
23
|
}
|
|
21
24
|
export declare class InternalTypeParser extends Callable<(...args: unknown[]) => BaseRoot | Generic, TypeParserAttachments> {
|
|
22
25
|
constructor($: InternalScope);
|
package/out/type.js
CHANGED
|
@@ -3,6 +3,17 @@ import { Callable } from "@ark/util";
|
|
|
3
3
|
import { parseGenericParams } from "./generic.js";
|
|
4
4
|
export class InternalTypeParser extends Callable {
|
|
5
5
|
constructor($) {
|
|
6
|
+
const attach = Object.assign({
|
|
7
|
+
errors: ArkErrors,
|
|
8
|
+
raw: $.parseRoot,
|
|
9
|
+
module: $.constructor.module,
|
|
10
|
+
scope: $.constructor.scope,
|
|
11
|
+
generic: $.generic,
|
|
12
|
+
// this won't be defined during bootstrapping, but externally always will be
|
|
13
|
+
ark: $.ambient
|
|
14
|
+
},
|
|
15
|
+
// also won't be defined during bootstrapping
|
|
16
|
+
$.ambientAttachments);
|
|
6
17
|
super((...args) => {
|
|
7
18
|
if (args.length === 1) {
|
|
8
19
|
// treat as a simple definition
|
|
@@ -26,12 +37,7 @@ export class InternalTypeParser extends Callable {
|
|
|
26
37
|
return $.parseRoot(args);
|
|
27
38
|
}, {
|
|
28
39
|
bind: $,
|
|
29
|
-
attach
|
|
30
|
-
errors: ArkErrors,
|
|
31
|
-
raw: $.parseRoot,
|
|
32
|
-
module: $.constructor.module,
|
|
33
|
-
scope: $.constructor.scope
|
|
34
|
-
}
|
|
40
|
+
attach
|
|
35
41
|
});
|
|
36
42
|
}
|
|
37
43
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "arktype",
|
|
3
3
|
"description": "TypeScript's 1:1 validator, optimized from editor to runtime",
|
|
4
|
-
"version": "2.0.0-rc.
|
|
4
|
+
"version": "2.0.0-rc.2",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "David Blass",
|
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
"out"
|
|
35
35
|
],
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@ark/util": "0.
|
|
38
|
-
"@ark/schema": "0.
|
|
37
|
+
"@ark/util": "0.5.0",
|
|
38
|
+
"@ark/schema": "0.5.0"
|
|
39
39
|
},
|
|
40
40
|
"publishConfig": {
|
|
41
41
|
"access": "public"
|