arktype 2.0.0-dev.4 → 2.0.0-dev.5
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 +123 -215
- package/__tests__/badDefinitionType.test.ts +2 -2
- package/__tests__/bounds.test.ts +448 -349
- package/__tests__/config.test.ts +8 -6
- package/__tests__/cyclic.test.ts +1 -1
- package/__tests__/dateLiteral.test.ts +2 -2
- package/__tests__/discrimination.test.ts +1 -1
- package/__tests__/divisor.test.ts +23 -19
- package/__tests__/enclosed.test.ts +7 -2
- package/__tests__/errors.test.ts +115 -0
- package/__tests__/expressions.test.ts +14 -20
- package/__tests__/generic.test.ts +4 -5
- package/__tests__/group.test.ts +8 -3
- package/__tests__/instanceof.test.ts +7 -7
- package/__tests__/intersection.test.ts +62 -38
- package/__tests__/keyTraversal.test.ts +0 -2
- package/__tests__/keyof.test.ts +15 -13
- package/__tests__/keywords.test.ts +29 -25
- package/__tests__/literal.test.ts +26 -8
- package/__tests__/match.test.ts +28 -16
- package/__tests__/morph.test.ts +187 -172
- package/__tests__/narrow.test.ts +38 -39
- package/__tests__/objectLiteral.test.ts +106 -76
- package/__tests__/realWorld.test.ts +62 -0
- package/__tests__/schema.bench.ts +14 -0
- package/__tests__/schema.test.ts +60 -0
- package/__tests__/scope.bench.ts +1 -1
- package/__tests__/scope.test.ts +8 -6
- package/__tests__/submodule.test.ts +2 -2
- package/__tests__/traverse.test.ts +34 -31
- package/__tests__/typeMethods.test.ts +2 -3
- package/__tests__/typeReference.test.ts +3 -3
- package/__tests__/unenclosed.test.ts +9 -3
- package/__tests__/union.test.ts +127 -55
- package/__tests__/unit.test.ts +61 -0
- package/base.ts +520 -0
- package/config.ts +25 -0
- package/constraints/ast.ts +288 -0
- package/constraints/constraint.ts +91 -0
- package/constraints/predicate.ts +102 -0
- package/constraints/props/index.ts +93 -0
- package/constraints/props/prop.ts +146 -0
- package/constraints/props/props.ts +148 -0
- package/constraints/props/sequence.ts +473 -0
- package/constraints/props/shared.ts +5 -0
- package/constraints/refinements/after.ts +68 -0
- package/constraints/refinements/before.ts +75 -0
- package/constraints/refinements/divisor.ts +76 -0
- package/constraints/refinements/exactLength.ts +75 -0
- package/constraints/refinements/kinds.ts +31 -0
- package/constraints/refinements/max.ts +61 -0
- package/constraints/refinements/maxLength.ts +66 -0
- package/constraints/refinements/min.ts +54 -0
- package/constraints/refinements/minLength.ts +63 -0
- package/constraints/refinements/range.ts +181 -0
- package/constraints/refinements/regex.ts +59 -0
- package/{ark.ts → keywords/ark.ts} +40 -30
- package/keywords/internal.ts +29 -0
- package/keywords/jsObject.ts +39 -0
- package/keywords/parsing.ts +87 -0
- package/keywords/root.ts +9 -0
- package/keywords/tsGenerics.ts +28 -0
- package/keywords/tsPrimitive.ts +52 -0
- package/keywords/utils/creditCard.ts +37 -0
- package/keywords/utils/date.ts +112 -0
- package/keywords/validation.ts +115 -0
- package/kinds.ts +115 -0
- package/main.ts +7 -8
- package/match.ts +30 -34
- package/out/ark.d.ts +5 -1
- package/out/ark.d.ts.map +1 -1
- package/out/ark.js +4 -1
- package/out/ark.js.map +1 -1
- package/out/base.d.ts +129 -0
- package/out/base.d.ts.map +1 -0
- package/out/base.js +274 -0
- package/out/base.js.map +1 -0
- package/out/builtins/builtins.d.ts +19 -0
- package/out/builtins/builtins.d.ts.map +1 -0
- package/out/builtins/builtins.js +12 -0
- package/out/builtins/builtins.js.map +1 -0
- package/out/builtins/jsObjects.d.ts +19 -0
- package/out/builtins/jsObjects.d.ts.map +1 -0
- package/out/builtins/jsObjects.js +15 -0
- package/out/builtins/jsObjects.js.map +1 -0
- package/out/builtins/parsing.d.ts +16 -0
- package/out/builtins/parsing.d.ts.map +1 -0
- package/out/builtins/parsing.js +59 -0
- package/out/builtins/parsing.js.map +1 -0
- package/out/builtins/tsGenerics.d.ts +2 -0
- package/out/builtins/tsGenerics.d.ts.map +1 -0
- package/out/builtins/tsGenerics.js +26 -0
- package/out/builtins/tsGenerics.js.map +1 -0
- package/out/builtins/tsKeywords.d.ts +23 -0
- package/out/builtins/tsKeywords.d.ts.map +1 -0
- package/out/builtins/tsKeywords.js +20 -0
- package/out/builtins/tsKeywords.js.map +1 -0
- package/out/builtins/utils/creditCard.d.ts +3 -0
- package/out/builtins/utils/creditCard.d.ts.map +1 -0
- package/out/builtins/utils/creditCard.js +36 -0
- package/out/builtins/utils/creditCard.js.map +1 -0
- package/out/builtins/utils/date.d.ts +22 -0
- package/out/builtins/utils/date.d.ts.map +1 -0
- package/out/builtins/utils/date.js +53 -0
- package/out/builtins/utils/date.js.map +1 -0
- package/out/builtins/validation.d.ts +19 -0
- package/out/builtins/validation.d.ts.map +1 -0
- package/out/builtins/validation.js +70 -0
- package/out/builtins/validation.js.map +1 -0
- package/out/config.d.ts +6 -0
- package/out/config.d.ts.map +1 -0
- package/out/config.js +17 -0
- package/out/config.js.map +1 -0
- package/out/constraints/ast.d.ts +176 -0
- package/out/constraints/ast.d.ts.map +1 -0
- package/out/constraints/ast.js +2 -0
- package/out/constraints/ast.js.map +1 -0
- package/out/constraints/constraint.d.ts +70 -0
- package/out/constraints/constraint.d.ts.map +1 -0
- package/out/constraints/constraint.js +21 -0
- package/out/constraints/constraint.js.map +1 -0
- package/out/constraints/predicate.d.ts +46 -0
- package/out/constraints/predicate.d.ts.map +1 -0
- package/out/constraints/predicate.js +47 -0
- package/out/constraints/predicate.js.map +1 -0
- package/out/constraints/props/index.d.ts +36 -0
- package/out/constraints/props/index.d.ts.map +1 -0
- package/out/constraints/props/index.js +48 -0
- package/out/constraints/props/index.js.map +1 -0
- package/out/constraints/props/optional.d.ts +34 -0
- package/out/constraints/props/optional.d.ts.map +1 -0
- package/out/constraints/props/optional.js +55 -0
- package/out/constraints/props/optional.js.map +1 -0
- package/out/constraints/props/prop.d.ts +46 -0
- package/out/constraints/props/prop.d.ts.map +1 -0
- package/out/constraints/props/prop.js +104 -0
- package/out/constraints/props/prop.js.map +1 -0
- package/out/constraints/props/props.d.ts +34 -0
- package/out/constraints/props/props.d.ts.map +1 -0
- package/out/constraints/props/props.js +106 -0
- package/out/constraints/props/props.js.map +1 -0
- package/out/constraints/props/required.d.ts +43 -0
- package/out/constraints/props/required.d.ts.map +1 -0
- package/out/constraints/props/required.js +76 -0
- package/out/constraints/props/required.js.map +1 -0
- package/out/constraints/props/sequence.d.ts +64 -0
- package/out/constraints/props/sequence.d.ts.map +1 -0
- package/out/constraints/props/sequence.js +327 -0
- package/out/constraints/props/sequence.js.map +1 -0
- package/out/constraints/props/shared.d.ts +3 -0
- package/out/constraints/props/shared.d.ts.map +1 -0
- package/out/constraints/props/shared.js +4 -0
- package/out/constraints/props/shared.js.map +1 -0
- package/out/constraints/refinements/after.d.ts +25 -0
- package/out/constraints/refinements/after.d.ts.map +1 -0
- package/out/constraints/refinements/after.js +35 -0
- package/out/constraints/refinements/after.js.map +1 -0
- package/out/constraints/refinements/before.d.ts +25 -0
- package/out/constraints/refinements/before.d.ts.map +1 -0
- package/out/constraints/refinements/before.js +41 -0
- package/out/constraints/refinements/before.js.map +1 -0
- package/out/constraints/refinements/divisor.d.ts +42 -0
- package/out/constraints/refinements/divisor.d.ts.map +1 -0
- package/out/constraints/refinements/divisor.js +41 -0
- package/out/constraints/refinements/divisor.js.map +1 -0
- package/out/constraints/refinements/exactLength.d.ts +41 -0
- package/out/constraints/refinements/exactLength.d.ts.map +1 -0
- package/out/constraints/refinements/exactLength.js +44 -0
- package/out/constraints/refinements/exactLength.js.map +1 -0
- package/out/constraints/refinements/kinds.d.ts +29 -0
- package/out/constraints/refinements/kinds.d.ts.map +1 -0
- package/out/constraints/refinements/kinds.js +17 -0
- package/out/constraints/refinements/kinds.js.map +1 -0
- package/out/constraints/refinements/length.d.ts +42 -0
- package/out/constraints/refinements/length.d.ts.map +1 -0
- package/out/constraints/refinements/length.js +45 -0
- package/out/constraints/refinements/length.js.map +1 -0
- package/out/constraints/refinements/max.d.ts +24 -0
- package/out/constraints/refinements/max.d.ts.map +1 -0
- package/out/constraints/refinements/max.js +31 -0
- package/out/constraints/refinements/max.js.map +1 -0
- package/out/constraints/refinements/maxLength.d.ts +24 -0
- package/out/constraints/refinements/maxLength.d.ts.map +1 -0
- package/out/constraints/refinements/maxLength.js +34 -0
- package/out/constraints/refinements/maxLength.js.map +1 -0
- package/out/constraints/refinements/min.d.ts +24 -0
- package/out/constraints/refinements/min.d.ts.map +1 -0
- package/out/constraints/refinements/min.js +25 -0
- package/out/constraints/refinements/min.js.map +1 -0
- package/out/constraints/refinements/minLength.d.ts +24 -0
- package/out/constraints/refinements/minLength.d.ts.map +1 -0
- package/out/constraints/refinements/minLength.js +32 -0
- package/out/constraints/refinements/minLength.js.map +1 -0
- package/out/constraints/refinements/range.d.ts +90 -0
- package/out/constraints/refinements/range.d.ts.map +1 -0
- package/out/constraints/refinements/range.js +72 -0
- package/out/constraints/refinements/range.js.map +1 -0
- package/out/constraints/refinements/regex.d.ts +43 -0
- package/out/constraints/refinements/regex.d.ts.map +1 -0
- package/out/constraints/refinements/regex.js +36 -0
- package/out/constraints/refinements/regex.js.map +1 -0
- package/out/constraints/refinements/shared.d.ts +5 -0
- package/out/constraints/refinements/shared.d.ts.map +1 -0
- package/out/constraints/refinements/shared.js +10 -0
- package/out/constraints/refinements/shared.js.map +1 -0
- package/out/inference.d.ts +40 -0
- package/out/inference.d.ts.map +1 -0
- package/out/inference.js +73 -0
- package/out/inference.js.map +1 -0
- package/out/keywords/ark.d.ts +60 -0
- package/out/keywords/ark.d.ts.map +1 -0
- package/out/keywords/ark.js +29 -0
- package/out/keywords/ark.js.map +1 -0
- package/out/keywords/internal.d.ts +13 -0
- package/out/keywords/internal.d.ts.map +1 -0
- package/out/keywords/internal.js +10 -0
- package/out/keywords/internal.js.map +1 -0
- package/out/keywords/jsObject.d.ts +20 -0
- package/out/keywords/jsObject.d.ts.map +1 -0
- package/out/keywords/jsObject.js +15 -0
- package/out/keywords/jsObject.js.map +1 -0
- package/out/keywords/parsing.d.ts +17 -0
- package/out/keywords/parsing.d.ts.map +1 -0
- package/out/keywords/parsing.js +61 -0
- package/out/keywords/parsing.js.map +1 -0
- package/out/keywords/root.d.ts +7 -0
- package/out/keywords/root.d.ts.map +1 -0
- package/out/keywords/root.js +4 -0
- package/out/keywords/root.js.map +1 -0
- package/out/keywords/tsGenerics.d.ts +2 -0
- package/out/keywords/tsGenerics.d.ts.map +1 -0
- package/out/keywords/tsGenerics.js +26 -0
- package/out/keywords/tsGenerics.js.map +1 -0
- package/out/keywords/tsPrimitive.d.ts +24 -0
- package/out/keywords/tsPrimitive.d.ts.map +1 -0
- package/out/keywords/tsPrimitive.js +22 -0
- package/out/keywords/tsPrimitive.js.map +1 -0
- package/out/keywords/utils/creditCard.d.ts +8 -0
- package/out/keywords/utils/creditCard.d.ts.map +1 -0
- package/out/keywords/utils/creditCard.js +36 -0
- package/out/keywords/utils/creditCard.js.map +1 -0
- package/out/keywords/utils/date.d.ts +25 -0
- package/out/keywords/utils/date.d.ts.map +1 -0
- package/out/keywords/utils/date.js +53 -0
- package/out/keywords/utils/date.js.map +1 -0
- package/out/keywords/validation.d.ts +20 -0
- package/out/keywords/validation.d.ts.map +1 -0
- package/out/keywords/validation.js +76 -0
- package/out/keywords/validation.js.map +1 -0
- package/out/kinds.d.ts +72 -0
- package/out/kinds.d.ts.map +1 -0
- package/out/kinds.js +29 -0
- package/out/kinds.js.map +1 -0
- package/out/main.d.ts +5 -4
- package/out/main.d.ts.map +1 -1
- package/out/main.js +2 -3
- package/out/main.js.map +1 -1
- package/out/match.d.ts +17 -18
- package/out/match.d.ts.map +1 -1
- package/out/match.js +3 -4
- package/out/match.js.map +1 -1
- package/out/parse.d.ts +23 -0
- package/out/parse.d.ts.map +1 -0
- package/out/parse.js +148 -0
- package/out/parse.js.map +1 -0
- package/out/parser/definition.d.ts +8 -9
- package/out/parser/definition.d.ts.map +1 -1
- package/out/parser/definition.js +8 -9
- package/out/parser/definition.js.map +1 -1
- package/out/parser/objectLiteral.d.ts +44 -11
- package/out/parser/objectLiteral.d.ts.map +1 -1
- package/out/parser/objectLiteral.js +47 -35
- package/out/parser/objectLiteral.js.map +1 -1
- package/out/parser/semantic/bounds.d.ts +8 -6
- package/out/parser/semantic/bounds.d.ts.map +1 -1
- package/out/parser/semantic/bounds.js.map +1 -1
- package/out/parser/semantic/divisor.d.ts +4 -6
- package/out/parser/semantic/divisor.d.ts.map +1 -1
- package/out/parser/semantic/infer.d.ts +28 -0
- package/out/parser/semantic/infer.d.ts.map +1 -0
- package/out/parser/semantic/infer.js +2 -0
- package/out/parser/semantic/infer.js.map +1 -0
- package/out/parser/semantic/utils.d.ts +3 -6
- package/out/parser/semantic/utils.d.ts.map +1 -1
- package/out/parser/semantic/validate.d.ts +1 -1
- package/out/parser/semantic/validate.d.ts.map +1 -1
- package/out/parser/semantic/validate.js.map +1 -1
- package/out/parser/string/reduce/dynamic.d.ts +13 -11
- package/out/parser/string/reduce/dynamic.d.ts.map +1 -1
- package/out/parser/string/reduce/dynamic.js +15 -9
- package/out/parser/string/reduce/dynamic.js.map +1 -1
- package/out/parser/string/reduce/shared.d.ts +2 -3
- package/out/parser/string/reduce/shared.d.ts.map +1 -1
- package/out/parser/string/reduce/shared.js.map +1 -1
- package/out/parser/string/reduce/static.d.ts +20 -19
- package/out/parser/string/reduce/static.d.ts.map +1 -1
- package/out/parser/string/shift/operand/date.d.ts +3 -2
- package/out/parser/string/shift/operand/date.d.ts.map +1 -1
- package/out/parser/string/shift/operand/date.js.map +1 -1
- package/out/parser/string/shift/operand/enclosed.d.ts +1 -1
- package/out/parser/string/shift/operand/enclosed.d.ts.map +1 -1
- package/out/parser/string/shift/operand/enclosed.js +6 -4
- package/out/parser/string/shift/operand/enclosed.js.map +1 -1
- package/out/parser/string/shift/operand/genericArgs.d.ts +4 -4
- package/out/parser/string/shift/operand/genericArgs.d.ts.map +1 -1
- package/out/parser/string/shift/operand/genericArgs.js.map +1 -1
- package/out/parser/string/shift/operand/operand.d.ts +2 -2
- package/out/parser/string/shift/operand/operand.d.ts.map +1 -1
- package/out/parser/string/shift/operand/operand.js.map +1 -1
- package/out/parser/string/shift/operand/unenclosed.d.ts +5 -6
- package/out/parser/string/shift/operand/unenclosed.d.ts.map +1 -1
- package/out/parser/string/shift/operand/unenclosed.js +5 -5
- package/out/parser/string/shift/operand/unenclosed.js.map +1 -1
- package/out/parser/string/shift/operator/bounds.d.ts +17 -12
- package/out/parser/string/shift/operator/bounds.d.ts.map +1 -1
- package/out/parser/string/shift/operator/bounds.js +28 -25
- package/out/parser/string/shift/operator/bounds.js.map +1 -1
- package/out/parser/string/shift/operator/divisor.d.ts +1 -1
- package/out/parser/string/shift/operator/divisor.d.ts.map +1 -1
- package/out/parser/string/shift/operator/divisor.js.map +1 -1
- package/out/parser/string/shift/scanner.d.ts.map +1 -1
- package/out/parser/string/string.d.ts +3 -3
- package/out/parser/string/string.d.ts.map +1 -1
- package/out/parser/string/string.js.map +1 -1
- package/out/parser/tuple.d.ts +95 -33
- package/out/parser/tuple.d.ts.map +1 -1
- package/out/parser/tuple.js +45 -48
- package/out/parser/tuple.js.map +1 -1
- package/out/schema.d.ts +44 -0
- package/out/schema.d.ts.map +1 -0
- package/out/schema.js +73 -0
- package/out/schema.js.map +1 -0
- package/out/schemaScope.d.ts +110 -0
- package/out/schemaScope.d.ts.map +1 -0
- package/out/schemaScope.js +212 -0
- package/out/schemaScope.js.map +1 -0
- package/out/scope.d.ts +98 -26
- package/out/scope.d.ts.map +1 -1
- package/out/scope.js +185 -45
- package/out/scope.js.map +1 -1
- package/out/shared/compile.d.ts +22 -0
- package/out/shared/compile.d.ts.map +1 -0
- package/out/shared/compile.js +67 -0
- package/out/shared/compile.js.map +1 -0
- package/out/shared/context.d.ts +29 -0
- package/out/shared/context.d.ts.map +1 -0
- package/out/shared/context.js +48 -0
- package/out/shared/context.js.map +1 -0
- package/out/shared/declare.d.ts +53 -0
- package/out/shared/declare.d.ts.map +1 -0
- package/out/shared/declare.js +2 -0
- package/out/shared/declare.js.map +1 -0
- package/out/shared/disjoint.d.ts +79 -0
- package/out/shared/disjoint.d.ts.map +1 -0
- package/out/shared/disjoint.js +82 -0
- package/out/shared/disjoint.js.map +1 -0
- package/out/shared/errors.d.ts +59 -0
- package/out/shared/errors.d.ts.map +1 -0
- package/out/shared/errors.js +108 -0
- package/out/shared/errors.js.map +1 -0
- package/out/shared/implement.d.ts +170 -0
- package/out/shared/implement.d.ts.map +1 -0
- package/out/shared/implement.js +69 -0
- package/out/shared/implement.js.map +1 -0
- package/out/shared/inference.d.ts +6 -0
- package/out/shared/inference.d.ts.map +1 -0
- package/out/shared/inference.js +5 -0
- package/out/shared/inference.js.map +1 -0
- package/out/shared/intersections.d.ts +15 -0
- package/out/shared/intersections.d.ts.map +1 -0
- package/out/shared/intersections.js.map +1 -0
- package/out/shared/traversal.d.ts +44 -0
- package/out/shared/traversal.d.ts.map +1 -0
- package/out/shared/traversal.js +97 -0
- package/out/shared/traversal.js.map +1 -0
- package/out/shared/utils.d.ts +8 -0
- package/out/shared/utils.d.ts.map +1 -0
- package/out/shared/utils.js +10 -0
- package/out/shared/utils.js.map +1 -0
- package/out/type.d.ts +10 -38
- package/out/type.d.ts.map +1 -1
- package/out/type.js +20 -106
- package/out/type.js.map +1 -1
- package/out/types/basis.d.ts +24 -0
- package/out/types/basis.d.ts.map +1 -0
- package/out/types/basis.js +15 -0
- package/out/types/basis.js.map +1 -0
- package/out/types/discriminate.d.ts +20 -0
- package/out/types/discriminate.d.ts.map +1 -0
- package/out/types/discriminate.js +114 -0
- package/out/types/discriminate.js.map +1 -0
- package/out/types/domain.d.ts +40 -0
- package/out/types/domain.d.ts.map +1 -0
- package/out/types/domain.js +38 -0
- package/out/types/domain.js.map +1 -0
- package/out/types/intersection.d.ts +67 -0
- package/out/types/intersection.d.ts.map +1 -0
- package/out/types/intersection.js +350 -0
- package/out/types/intersection.js.map +1 -0
- package/out/types/morph.d.ts +79 -0
- package/out/types/morph.d.ts.map +1 -0
- package/out/types/morph.js +95 -0
- package/out/types/morph.js.map +1 -0
- package/out/types/proto.d.ts +42 -0
- package/out/types/proto.d.ts.map +1 -0
- package/out/types/proto.js +48 -0
- package/out/types/proto.js.map +1 -0
- package/out/types/type.d.ts +61 -0
- package/out/types/type.d.ts.map +1 -0
- package/out/types/type.js +111 -0
- package/out/types/type.js.map +1 -0
- package/out/types/union.d.ts +48 -0
- package/out/types/union.d.ts.map +1 -0
- package/out/types/union.js +337 -0
- package/out/types/union.js.map +1 -0
- package/out/types/unit.d.ts +40 -0
- package/out/types/unit.d.ts.map +1 -0
- package/out/types/unit.js +48 -0
- package/out/types/unit.js.map +1 -0
- package/out/util.d.ts +5 -2
- package/out/util.d.ts.map +1 -1
- package/out/util.js.map +1 -1
- package/package.json +6 -3
- package/parse.ts +221 -0
- package/parser/definition.ts +24 -23
- package/parser/objectLiteral.ts +128 -88
- package/parser/semantic/bounds.ts +18 -9
- package/parser/semantic/divisor.ts +12 -10
- package/parser/semantic/infer.ts +152 -0
- package/parser/semantic/utils.ts +5 -13
- package/parser/semantic/validate.ts +1 -2
- package/parser/string/reduce/dynamic.ts +42 -30
- package/parser/string/reduce/shared.ts +1 -3
- package/parser/string/reduce/static.ts +22 -22
- package/parser/string/shift/operand/date.ts +9 -5
- package/parser/string/shift/operand/enclosed.ts +11 -5
- package/parser/string/shift/operand/genericArgs.ts +6 -6
- package/parser/string/shift/operand/operand.ts +1 -2
- package/parser/string/shift/operand/unenclosed.ts +14 -20
- package/parser/string/shift/operator/bounds.ts +59 -54
- package/parser/string/shift/operator/divisor.ts +2 -2
- package/parser/string/shift/scanner.ts +10 -10
- package/parser/string/string.ts +4 -4
- package/parser/tuple.ts +224 -202
- package/schema.ts +263 -0
- package/scope.ts +358 -81
- package/shared/compile.ts +92 -0
- package/shared/declare.ts +75 -0
- package/shared/disjoint.ts +203 -0
- package/shared/errors.ts +204 -0
- package/shared/implement.ts +327 -0
- package/shared/inference.ts +9 -0
- package/shared/intersections.ts +53 -0
- package/shared/traversal.ts +146 -0
- package/shared/utils.ts +30 -0
- package/type.ts +23 -183
- package/types/basis.ts +62 -0
- package/types/discriminate.ts +168 -0
- package/types/domain.ts +79 -0
- package/types/intersection.ts +539 -0
- package/types/morph.ts +263 -0
- package/types/proto.ts +89 -0
- package/types/type.ts +319 -0
- package/types/union.ts +451 -0
- package/types/unit.ts +78 -0
- package/util.ts +5 -2
- package/__tests__/astUtils.test.ts +0 -17
- package/__tests__/jsdoc.test.ts +0 -64
- package/__tests__/nodeDefinitions.test.ts +0 -190
- 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/parser/semantic/intersections.d.ts +0 -14
- package/out/parser/semantic/intersections.d.ts.map +0 -1
- package/out/parser/semantic/intersections.js.map +0 -1
- package/out/parser/semantic/semantic.d.ts +0 -32
- 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/shared.d.ts +0 -62
- package/out/parser/shared.d.ts.map +0 -1
- package/out/parser/shared.js +0 -56
- package/out/parser/shared.js.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/parser/semantic/semantic.ts +0 -143
- package/parser/shared.ts +0 -170
- /package/out/{parser/semantic → shared}/intersections.js +0 -0
package/out/scope.js
CHANGED
|
@@ -1,23 +1,64 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { CompiledFunction, domainOf, hasDomain, isArray, isThunk, morph, throwInternalError, throwParseError } from "@arktype/util";
|
|
2
|
+
import { typeKindOfSchema } from "./base.js";
|
|
3
|
+
import { globalConfig, mergeConfigs } from "./config.js";
|
|
4
|
+
import { nodesByKind } from "./kinds.js";
|
|
3
5
|
import { createMatchParser } from "./match.js";
|
|
6
|
+
import { parseAttachments } from "./parse.js";
|
|
4
7
|
import { parseObject, writeBadDefinitionTypeMessage } from "./parser/definition.js";
|
|
5
8
|
import { parseGenericParams } from "./parser/generic.js";
|
|
6
9
|
import { DynamicState } from "./parser/string/reduce/dynamic.js";
|
|
7
10
|
import { writeMissingSubmoduleAccessMessage, writeNonSubmoduleDotMessage, writeUnresolvableMessage } from "./parser/string/shift/operand/unenclosed.js";
|
|
8
11
|
import { fullStringParse } from "./parser/string/string.js";
|
|
9
|
-
import {
|
|
12
|
+
import { NodeCompiler } from "./shared/compile.js";
|
|
13
|
+
import { isNodeKind } from "./shared/implement.js";
|
|
14
|
+
import { createTypeParser, generic, validateUninstantiatedGeneric } from "./type.js";
|
|
15
|
+
import { BaseType } from "./types/type.js";
|
|
10
16
|
import { addArkKind, hasArkKind } from "./util.js";
|
|
17
|
+
export const defaultConfig = Object.assign(morph(nodesByKind, (kind, node) => [kind, node.implementation.defaults]), {
|
|
18
|
+
prereducedAliases: false,
|
|
19
|
+
ambient: null,
|
|
20
|
+
registerKeywords: false
|
|
21
|
+
});
|
|
22
|
+
const nonInheritedKeys = [
|
|
23
|
+
"registerKeywords",
|
|
24
|
+
"prereducedAliases"
|
|
25
|
+
];
|
|
26
|
+
const extendConfig = (base, extension) => {
|
|
27
|
+
if (!extension)
|
|
28
|
+
return base;
|
|
29
|
+
const result = mergeConfigs(base, extension);
|
|
30
|
+
nonInheritedKeys.forEach((k) => {
|
|
31
|
+
if (!(k in extension))
|
|
32
|
+
delete result[k];
|
|
33
|
+
});
|
|
34
|
+
return result;
|
|
35
|
+
};
|
|
36
|
+
const resolveConfig = (scopeConfig) => extendConfig(defaultConfig, scopeConfig);
|
|
11
37
|
export class Scope {
|
|
12
38
|
config;
|
|
39
|
+
resolvedConfig;
|
|
13
40
|
parseCache = {};
|
|
14
41
|
resolutions;
|
|
42
|
+
nodeCache = {};
|
|
43
|
+
referencesByName = {};
|
|
44
|
+
references = [];
|
|
45
|
+
json = {};
|
|
46
|
+
resolved = false;
|
|
47
|
+
// these allow builtin types to be accessed during parsing without cyclic imports
|
|
48
|
+
// they are populated as each scope is parsed with `registerKeywords` in its config
|
|
49
|
+
/** @internal */
|
|
50
|
+
static keywords = {};
|
|
51
|
+
/** @internal */
|
|
52
|
+
get keywords() {
|
|
53
|
+
return Scope.keywords;
|
|
54
|
+
}
|
|
15
55
|
/** The set of names defined at the root-level of the scope mapped to their
|
|
16
56
|
* corresponding definitions.**/
|
|
17
57
|
aliases = {};
|
|
18
58
|
exportedNames = [];
|
|
19
|
-
ambient;
|
|
20
59
|
constructor(def, config) {
|
|
60
|
+
this.config = extendConfig(globalConfig, config);
|
|
61
|
+
this.resolvedConfig = resolveConfig(this.config);
|
|
21
62
|
for (const k in def) {
|
|
22
63
|
const parsedKey = parseScopeKey(k);
|
|
23
64
|
this.aliases[parsedKey.name] = parsedKey.params.length
|
|
@@ -27,56 +68,53 @@ export class Scope {
|
|
|
27
68
|
this.exportedNames.push(parsedKey.name);
|
|
28
69
|
}
|
|
29
70
|
}
|
|
30
|
-
this.
|
|
31
|
-
if (this.ambient) {
|
|
71
|
+
if (this.config.ambient) {
|
|
32
72
|
// ensure exportedResolutions is populated
|
|
33
|
-
this.ambient.export();
|
|
34
|
-
this.resolutions = { ...this.ambient.exportedResolutions };
|
|
73
|
+
this.config.ambient.export();
|
|
74
|
+
this.resolutions = { ...this.config.ambient.exportedResolutions };
|
|
35
75
|
}
|
|
36
76
|
else {
|
|
37
77
|
this.resolutions = {};
|
|
38
78
|
}
|
|
39
|
-
this.
|
|
79
|
+
this.node("union", {
|
|
80
|
+
branches: [
|
|
81
|
+
"string",
|
|
82
|
+
"number",
|
|
83
|
+
"object",
|
|
84
|
+
"bigint",
|
|
85
|
+
"symbol",
|
|
86
|
+
{ unit: true },
|
|
87
|
+
{ unit: false },
|
|
88
|
+
{ unit: null },
|
|
89
|
+
{ unit: undefined }
|
|
90
|
+
]
|
|
91
|
+
}, { reduceTo: this.node("intersection", {}, { prereduced: true }) });
|
|
40
92
|
}
|
|
41
|
-
static root = (aliases) => {
|
|
42
|
-
return new Scope(aliases, {});
|
|
43
|
-
};
|
|
44
93
|
type = createTypeParser(this);
|
|
94
|
+
schema = this.rawSchema.bind(this);
|
|
95
|
+
rawSchema(schema) {
|
|
96
|
+
return ["schema", schema];
|
|
97
|
+
}
|
|
45
98
|
match = createMatchParser(this);
|
|
46
|
-
// TODO: decide if this API will be used for non-validated types
|
|
47
99
|
declare = () => ({ type: this.type });
|
|
48
|
-
scope = ((def, config = {}) => {
|
|
49
|
-
return new Scope(def, {
|
|
50
|
-
ambient: this.ambient,
|
|
51
|
-
...this.config,
|
|
52
|
-
...config
|
|
53
|
-
});
|
|
54
|
-
});
|
|
100
|
+
scope = ((def, config = {}) => new Scope({ ...this.import(), ...def }, extendConfig(this.config, config)));
|
|
55
101
|
define = (def) => def;
|
|
56
102
|
toAmbient() {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}
|
|
103
|
+
;
|
|
104
|
+
this.config = {
|
|
105
|
+
...this.config,
|
|
106
|
+
ambient: this
|
|
107
|
+
};
|
|
108
|
+
return this;
|
|
62
109
|
}
|
|
63
110
|
// TODO: name?
|
|
64
111
|
get(name) {
|
|
65
112
|
return this.export()[name];
|
|
66
113
|
}
|
|
67
|
-
createRootContext(input) {
|
|
68
|
-
return {
|
|
69
|
-
path: [],
|
|
70
|
-
scope: this,
|
|
71
|
-
...input
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
parseDefinition(def, input) {
|
|
75
|
-
return this.parse(def, this.createRootContext(input));
|
|
76
|
-
}
|
|
77
114
|
parse(def, ctx) {
|
|
78
115
|
if (typeof def === "string") {
|
|
79
116
|
if (ctx.args !== undefined) {
|
|
117
|
+
// TODO: allow caching with this by serializing it?
|
|
80
118
|
// we can only rely on the cache if there are no contextual
|
|
81
119
|
// resolutions like "this" or generic args
|
|
82
120
|
return this.parseString(def, ctx);
|
|
@@ -90,6 +128,17 @@ export class Scope {
|
|
|
90
128
|
? parseObject(def, ctx)
|
|
91
129
|
: throwParseError(writeBadDefinitionTypeMessage(domainOf(def)));
|
|
92
130
|
}
|
|
131
|
+
parseTypeRoot(def, input) {
|
|
132
|
+
const result = this.parse(def, {
|
|
133
|
+
args: { this: {} },
|
|
134
|
+
baseName: "type",
|
|
135
|
+
path: [],
|
|
136
|
+
$: this,
|
|
137
|
+
...input
|
|
138
|
+
}).bindScope(this);
|
|
139
|
+
this.bindCompiledScope(result.contributesReferences);
|
|
140
|
+
return result;
|
|
141
|
+
}
|
|
93
142
|
parseString(def, ctx) {
|
|
94
143
|
return (this.maybeResolveNode(def) ??
|
|
95
144
|
((def.endsWith("[]") &&
|
|
@@ -102,9 +151,8 @@ export class Scope {
|
|
|
102
151
|
return cached;
|
|
103
152
|
}
|
|
104
153
|
let def = this.aliases[name];
|
|
105
|
-
if (!def)
|
|
154
|
+
if (!def)
|
|
106
155
|
return this.maybeResolveSubalias(name);
|
|
107
|
-
}
|
|
108
156
|
if (isThunk(def) && !hasArkKind(def, "generic")) {
|
|
109
157
|
def = def();
|
|
110
158
|
}
|
|
@@ -113,7 +161,7 @@ export class Scope {
|
|
|
113
161
|
? validateUninstantiatedGeneric(def)
|
|
114
162
|
: hasArkKind(def, "module")
|
|
115
163
|
? throwParseError(writeMissingSubmoduleAccessMessage(name))
|
|
116
|
-
: this.
|
|
164
|
+
: this.parseTypeRoot(def, { baseName: name, args: {} });
|
|
117
165
|
this.resolutions[name] = resolution;
|
|
118
166
|
return resolution;
|
|
119
167
|
}
|
|
@@ -126,7 +174,7 @@ export class Scope {
|
|
|
126
174
|
const dotPrefix = name.slice(0, dotIndex);
|
|
127
175
|
const prefixDef = this.aliases[dotPrefix];
|
|
128
176
|
if (hasArkKind(prefixDef, "module")) {
|
|
129
|
-
const resolution = prefixDef[name.slice(dotIndex + 1)]
|
|
177
|
+
const resolution = prefixDef[name.slice(dotIndex + 1)];
|
|
130
178
|
// if the first part of name is a submodule but the suffix is
|
|
131
179
|
// unresolvable, we can throw immediately
|
|
132
180
|
if (!resolution) {
|
|
@@ -151,10 +199,6 @@ export class Scope {
|
|
|
151
199
|
value
|
|
152
200
|
]), "module");
|
|
153
201
|
}
|
|
154
|
-
bindThis() {
|
|
155
|
-
// TODO: fix
|
|
156
|
-
return { this: keywords.unknown };
|
|
157
|
-
}
|
|
158
202
|
exportedResolutions;
|
|
159
203
|
exportCache;
|
|
160
204
|
export(...names) {
|
|
@@ -176,11 +220,21 @@ export class Scope {
|
|
|
176
220
|
this.exportCache[name] = def;
|
|
177
221
|
}
|
|
178
222
|
else {
|
|
179
|
-
this.exportCache[name] =
|
|
223
|
+
this.exportCache[name] = this.parseTypeRoot(def, {
|
|
224
|
+
baseName: name,
|
|
225
|
+
args: {}
|
|
226
|
+
});
|
|
180
227
|
}
|
|
181
228
|
}
|
|
182
229
|
this.exportedResolutions = resolutionsOfModule(this.exportCache);
|
|
230
|
+
// TODO: add generic json
|
|
231
|
+
this.json = morph(this.exportedResolutions, (k, v) => hasArkKind(v, "node") ? [k, v.json] : []);
|
|
183
232
|
Object.assign(this.resolutions, this.exportedResolutions);
|
|
233
|
+
if (this.config.registerKeywords)
|
|
234
|
+
Object.assign(Scope.keywords, this.exportedResolutions);
|
|
235
|
+
this.references = Object.values(this.referencesByName);
|
|
236
|
+
this.bindCompiledScope(this.references);
|
|
237
|
+
this.resolved = true;
|
|
184
238
|
}
|
|
185
239
|
const namesToExport = names.length ? names : this.exportedNames;
|
|
186
240
|
return addArkKind(morph(namesToExport, (_, name) => [
|
|
@@ -188,6 +242,92 @@ export class Scope {
|
|
|
188
242
|
this.exportCache[name]
|
|
189
243
|
]), "module");
|
|
190
244
|
}
|
|
245
|
+
parseUnits(...values) {
|
|
246
|
+
const uniqueValues = [];
|
|
247
|
+
for (const value of values) {
|
|
248
|
+
if (!uniqueValues.includes(value)) {
|
|
249
|
+
uniqueValues.push(value);
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
const branches = uniqueValues.map((unit) => this.node("unit", { unit }));
|
|
253
|
+
return branches.length === 1
|
|
254
|
+
? branches[0]
|
|
255
|
+
: this.node(branches, { root: true, prereduced: true });
|
|
256
|
+
}
|
|
257
|
+
node = this.internalNodeParser.bind(this);
|
|
258
|
+
internalNodeParser(schemaOrKind, schemaOrOpts, constraintOpts) {
|
|
259
|
+
const kindArg = isNodeKind(schemaOrKind) ? schemaOrKind : undefined;
|
|
260
|
+
let schema = kindArg ? schemaOrOpts : schemaOrKind;
|
|
261
|
+
const opts = kindArg
|
|
262
|
+
? constraintOpts
|
|
263
|
+
: schemaOrOpts;
|
|
264
|
+
if (opts?.alias && opts.alias in this.resolutions) {
|
|
265
|
+
return throwInternalError(`Unexpected attempt to recreate existing alias ${opts.alias}`);
|
|
266
|
+
}
|
|
267
|
+
let kind = kindArg ?? typeKindOfSchema(schema);
|
|
268
|
+
if (kind === "union" && isArray(schema) && schema.length === 1) {
|
|
269
|
+
schema = schema[0];
|
|
270
|
+
kind = typeKindOfSchema(schema);
|
|
271
|
+
}
|
|
272
|
+
if (opts?.allowedKinds && !opts.allowedKinds.includes(kind)) {
|
|
273
|
+
return throwParseError(`Schema of kind ${kind} should be one of ${opts.allowedKinds}`);
|
|
274
|
+
}
|
|
275
|
+
const node = parseAttachments(kind, schema, {
|
|
276
|
+
$: this,
|
|
277
|
+
prereduced: opts?.prereduced ?? false,
|
|
278
|
+
raw: schema,
|
|
279
|
+
...opts
|
|
280
|
+
});
|
|
281
|
+
if (opts?.root) {
|
|
282
|
+
if (this.resolved) {
|
|
283
|
+
// this node was not part of the original scope, so compile an anonymous scope
|
|
284
|
+
// including only its references
|
|
285
|
+
this.bindCompiledScope(node.contributesReferences);
|
|
286
|
+
}
|
|
287
|
+
else {
|
|
288
|
+
// we're still parsing the scope itself, so defer compilation but
|
|
289
|
+
// add the node as a reference
|
|
290
|
+
Object.assign(this.referencesByName, node.contributesReferencesByName);
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
return node;
|
|
294
|
+
}
|
|
295
|
+
bindCompiledScope(references) {
|
|
296
|
+
const compiledTraversals = this.compileScope(references);
|
|
297
|
+
for (const node of references) {
|
|
298
|
+
if (node.jit) {
|
|
299
|
+
// if node has already been bound to another scope or anonymous type, don't rebind it
|
|
300
|
+
continue;
|
|
301
|
+
}
|
|
302
|
+
node.jit = true;
|
|
303
|
+
node.traverseAllows =
|
|
304
|
+
compiledTraversals[`${node.reference}Allows`].bind(compiledTraversals);
|
|
305
|
+
if (node.isType() && !node.includesContextDependentPredicate) {
|
|
306
|
+
// if the reference doesn't require context, we can assign over
|
|
307
|
+
// it directly to avoid having to initialize it
|
|
308
|
+
node.allows = node.traverseAllows;
|
|
309
|
+
}
|
|
310
|
+
node.traverseApply =
|
|
311
|
+
compiledTraversals[`${node.reference}Apply`].bind(compiledTraversals);
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
compileScope(references) {
|
|
315
|
+
return new CompiledFunction()
|
|
316
|
+
.block(`return`, (js) => {
|
|
317
|
+
references.forEach((node) => {
|
|
318
|
+
const allowsCompiler = new NodeCompiler("Allows").indent();
|
|
319
|
+
node.compile(allowsCompiler);
|
|
320
|
+
const applyCompiler = new NodeCompiler("Apply").indent();
|
|
321
|
+
node.compile(applyCompiler);
|
|
322
|
+
js.line(allowsCompiler.writeMethod(`${node.reference}Allows`) +
|
|
323
|
+
",\n" +
|
|
324
|
+
applyCompiler.writeMethod(`${node.reference}Apply`) +
|
|
325
|
+
",");
|
|
326
|
+
});
|
|
327
|
+
return js;
|
|
328
|
+
})
|
|
329
|
+
.compile()();
|
|
330
|
+
}
|
|
191
331
|
}
|
|
192
332
|
const resolutionsOfModule = (typeSet) => {
|
|
193
333
|
const result = {};
|
|
@@ -205,7 +345,7 @@ const resolutionsOfModule = (typeSet) => {
|
|
|
205
345
|
result[k] = v;
|
|
206
346
|
}
|
|
207
347
|
else {
|
|
208
|
-
result[k] = v
|
|
348
|
+
result[k] = v;
|
|
209
349
|
}
|
|
210
350
|
}
|
|
211
351
|
return result;
|
package/out/scope.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scope.js","sourceRoot":"","sources":["../scope.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,QAAQ,EACR,QAAQ,EAKR,MAAM,iBAAiB,CAAA;AACxB,OAAO,EACN,QAAQ,EACR,SAAS,EACT,OAAO,EACP,KAAK,EACL,eAAe,EAKf,MAAM,eAAe,CAAA;AAEtB,OAAO,EAAE,iBAAiB,EAAoB,MAAM,YAAY,CAAA;AAChE,OAAO,EACN,WAAW,EACX,6BAA6B,EAG7B,MAAM,wBAAwB,CAAA;AAC/B,OAAO,EACN,kBAAkB,EAGlB,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAA;AAChE,OAAO,EACN,kCAAkC,EAClC,2BAA2B,EAC3B,wBAAwB,EACxB,MAAM,6CAA6C,CAAA;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAC3D,OAAO,EACN,IAAI,EACJ,gBAAgB,EAChB,OAAO,EACP,6BAA6B,EAM7B,MAAM,WAAW,CAAA;AAClB,OAAO,EAAE,UAAU,EAAE,UAAU,EAAgB,MAAM,WAAW,CAAA;AA4KhE,MAAM,OAAO,KAAK;IAIjB,MAAM,CAAgB;IAEd,UAAU,GAA6B,EAAE,CAAA;IACzC,WAAW,CAAmB;IAEtC;oCACgC;IAChC,OAAO,GAA4B,EAAE,CAAA;IAC7B,aAAa,GAAsB,EAAE,CAAA;IACrC,OAAO,CAAc;IAE7B,YAAY,GAAS,EAAE,MAAsB;QAC5C,KAAK,MAAM,CAAC,IAAI,GAAG,EAAE,CAAC;YACrB,MAAM,SAAS,GAAG,aAAa,CAAC,CAAC,CAAC,CAAA;YAClC,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC,MAAM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CAAC,CAAA;AAoBD,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAC5C,IAAY,EACZ,IAAc,EACL,EAAE,CACX,UAAU,IAAI,qCAAqC,CAAC,GAAG,IAAI,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAA;AAE/E,MAAM,CAAC,MAAM,yBAAyB,GAAG,CACxC,IAAU,EACwB,EAAE,CAAC,mBAAmB,IAAI,GAAG,CAAA;AAUhE,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAS,EAAkB,EAAE;IAC1D,MAAM,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG,CAAA;IAC5B,MAAM,IAAI,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;IACrC,MAAM,eAAe,GAAG,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;IACtC,IAAI,eAAe,KAAK,CAAC,CAAC,EAAE,CAAC;QAC5B,OAAO;YACN,OAAO;YACP,IAAI;YACJ,MAAM,EAAE,EAAE;SACV,CAAA;IACF,CAAC;IACD,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE,CAAC;QACtB,eAAe,CACd,oEAAoE,CACpE,CAAA;IACF,CAAC;IACD,OAAO;QACN,OAAO;QACP,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,eAAe,CAAC;QACpC,MAAM,EAAE,kBAAkB,CAAC,CAAC,CAAC,KAAK,CAAC,eAAe,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;KAC5D,CAAA;AACF,CAAC,CAAA"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { CompiledFunction } from "@arktype/util";
|
|
2
|
+
import type { Node, UnknownNode } from "../base.js";
|
|
3
|
+
import type { Discriminant } from "../types/discriminate.js";
|
|
4
|
+
import type { PrimitiveKind } from "./implement.js";
|
|
5
|
+
import type { TraversalKind } from "./traversal.js";
|
|
6
|
+
export type InvokeOptions = {
|
|
7
|
+
arg?: string;
|
|
8
|
+
kind?: TraversalKind;
|
|
9
|
+
};
|
|
10
|
+
export declare class NodeCompiler extends CompiledFunction<["data", "ctx"]> {
|
|
11
|
+
traversalKind: TraversalKind;
|
|
12
|
+
path: string[];
|
|
13
|
+
discriminants: Discriminant[];
|
|
14
|
+
constructor(traversalKind: TraversalKind);
|
|
15
|
+
invoke(node: UnknownNode, opts?: InvokeOptions): string;
|
|
16
|
+
requiresContextFor(node: UnknownNode): boolean;
|
|
17
|
+
checkReferenceKey(keyExpression: string, node: UnknownNode): this;
|
|
18
|
+
check(node: UnknownNode, opts?: InvokeOptions): this;
|
|
19
|
+
compilePrimitive(node: Node<PrimitiveKind>): this;
|
|
20
|
+
writeMethod(name: string): string;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=compile.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compile.d.ts","sourceRoot":"","sources":["../../shared/compile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAA0B,MAAM,eAAe,CAAA;AACxE,OAAO,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AACnD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AACnD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAEnD,MAAM,MAAM,aAAa,GAAG;IAC3B,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,IAAI,CAAC,EAAE,aAAa,CAAA;CACpB,CAAA;AAED,qBAAa,YAAa,SAAQ,gBAAgB,CAAC,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IAI/C,aAAa,EAAE,aAAa;IAH/C,IAAI,EAAE,MAAM,EAAE,CAAK;IACnB,aAAa,EAAE,YAAY,EAAE,CAAK;gBAEf,aAAa,EAAE,aAAa;IAI/C,MAAM,CAAC,IAAI,EAAE,WAAW,EAAE,IAAI,CAAC,EAAE,aAAa,GAAG,MAAM;IAUvD,kBAAkB,CAAC,IAAI,EAAE,WAAW,GAAG,OAAO;IAM9C,iBAAiB,CAAC,aAAa,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,GAAG,IAAI;IAcjE,KAAK,CAAC,IAAI,EAAE,WAAW,EAAE,IAAI,CAAC,EAAE,aAAa,GAAG,IAAI;IAMpD,gBAAgB,CAAC,IAAI,EAAE,IAAI,CAAC,aAAa,CAAC,GAAG,IAAI;IAiCjD,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;CAGjC"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { CompiledFunction, compileSerializedValue } from "@arktype/util";
|
|
2
|
+
export class NodeCompiler extends CompiledFunction {
|
|
3
|
+
traversalKind;
|
|
4
|
+
path = [];
|
|
5
|
+
discriminants = [];
|
|
6
|
+
constructor(traversalKind) {
|
|
7
|
+
super("data", "ctx");
|
|
8
|
+
this.traversalKind = traversalKind;
|
|
9
|
+
}
|
|
10
|
+
invoke(node, opts) {
|
|
11
|
+
const invokedKind = opts?.kind ?? this.traversalKind;
|
|
12
|
+
const method = `${node.reference}${invokedKind}`;
|
|
13
|
+
const arg = opts?.arg ?? this.data;
|
|
14
|
+
if (this.requiresContextFor(node)) {
|
|
15
|
+
return `this.${method}(${arg}, ${this.ctx})`;
|
|
16
|
+
}
|
|
17
|
+
return `this.${method}(${arg})`;
|
|
18
|
+
}
|
|
19
|
+
requiresContextFor(node) {
|
|
20
|
+
return (this.traversalKind === "Apply" || node.includesContextDependentPredicate);
|
|
21
|
+
}
|
|
22
|
+
checkReferenceKey(keyExpression, node) {
|
|
23
|
+
const requiresContext = this.requiresContextFor(node);
|
|
24
|
+
if (requiresContext) {
|
|
25
|
+
this.line(`${this.ctx}.path.push(${keyExpression})`);
|
|
26
|
+
}
|
|
27
|
+
this.check(node, {
|
|
28
|
+
arg: `${this.data}${this.index(keyExpression)}`
|
|
29
|
+
});
|
|
30
|
+
if (requiresContext) {
|
|
31
|
+
this.line(`${this.ctx}.path.pop()`);
|
|
32
|
+
}
|
|
33
|
+
return this;
|
|
34
|
+
}
|
|
35
|
+
check(node, opts) {
|
|
36
|
+
return this.traversalKind === "Allows"
|
|
37
|
+
? this.if(`!${this.invoke(node, opts)}`, () => this.return(false))
|
|
38
|
+
: this.line(this.invoke(node, opts));
|
|
39
|
+
}
|
|
40
|
+
compilePrimitive(node) {
|
|
41
|
+
const pathString = this.path.join();
|
|
42
|
+
if (node.kind === "domain" &&
|
|
43
|
+
node.domain === "object" &&
|
|
44
|
+
this.discriminants.some((d) => d.path.join().startsWith(pathString))) {
|
|
45
|
+
// if we've already checked a path at least as long as the current one,
|
|
46
|
+
// we don't need to revalidate that we're in an object
|
|
47
|
+
return this;
|
|
48
|
+
}
|
|
49
|
+
if ((node.kind === "domain" || node.kind === "unit") &&
|
|
50
|
+
this.discriminants.some((d) => d.path.join() === pathString &&
|
|
51
|
+
(node.kind === "domain"
|
|
52
|
+
? d.kind === "domain" || d.kind === "value"
|
|
53
|
+
: d.kind === "value"))) {
|
|
54
|
+
// if the discriminant has already checked the domain at the current path
|
|
55
|
+
// (or an exact value, implying a domain), we don't need to recheck it
|
|
56
|
+
return this;
|
|
57
|
+
}
|
|
58
|
+
if (this.traversalKind === "Allows") {
|
|
59
|
+
return this.return(node.compiledCondition);
|
|
60
|
+
}
|
|
61
|
+
return this.if(node.compiledNegation, () => this.line(`${this.ctx}.error(${node.compiledErrorContext})`));
|
|
62
|
+
}
|
|
63
|
+
writeMethod(name) {
|
|
64
|
+
return `${name}(${this.argNames.join(", ")}){\n${this.body} }\n`;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=compile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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AAC,IAAI,KAAK,QAAQ;oBACtB,CAAC,CAAC,CAAC,CAAC,IAAI,KAAK,QAAQ,IAAI,CAAC,CAAC,IAAI,KAAK,OAAO;oBAC3C,CAAC,CAAC,CAAC,CAAC,IAAI,KAAK,OAAO,CAAC,CACvB,EACA,CAAC;YACF,yEAAyE;YACzE,sEAAsE;YACtE,OAAO,IAAI,CAAA;QACZ,CAAC;QACD,IAAI,IAAI,CAAC,aAAa,KAAK,QAAQ,EAAE,CAAC;YACrC,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAA;QAC3C,CAAC;QACD,OAAO,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,gBAAgB,EAAE,GAAG,EAAE,CAC1C,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,GAAG,UAAU,IAAI,CAAC,oBAAoB,GAAG,CAAC,CAC5D,CAAA;IACF,CAAC;IAED,WAAW,CAAC,IAAY;QACvB,OAAO,GAAG,IAAI,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,IAAI,CAAC,IAAI,SAAS,CAAA;IACpE,CAAC;CACD"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ArkErrors, type ArkErrorInput } from "./errors.js";
|
|
2
|
+
import type { ParsedArkConfig } from "../schemaScope.js";
|
|
3
|
+
export type TraversalPath = (string | symbol)[];
|
|
4
|
+
export declare const pathToPropString: (path: TraversalPath) => string;
|
|
5
|
+
export declare class TraversalContext {
|
|
6
|
+
root: unknown;
|
|
7
|
+
config: ParsedArkConfig;
|
|
8
|
+
path: TraversalPath;
|
|
9
|
+
errorsStack: ArkErrors[];
|
|
10
|
+
entriesToPrune: [data: Record<string, unknown>, key: string][];
|
|
11
|
+
seen: {
|
|
12
|
+
[name in string]?: object[];
|
|
13
|
+
};
|
|
14
|
+
constructor(root: unknown, config: ParsedArkConfig);
|
|
15
|
+
get currentErrors(): ArkErrors;
|
|
16
|
+
get error(): (input: ArkErrorInput) => import("./errors.js").ArkTypeError<"max" | "min" | "maxLength" | "minLength" | "before" | "after" | "length" | "union" | "unit" | "intersection" | "proto" | "domain" | "regex" | "divisor" | "required" | "predicate">;
|
|
17
|
+
get data(): unknown;
|
|
18
|
+
invalid(input: ArkErrorInput): false;
|
|
19
|
+
pushUnion(): void;
|
|
20
|
+
popUnion(branchCount: number, data: unknown, path: string[]): void;
|
|
21
|
+
}
|
|
22
|
+
export type TraversalMethodsByKind<input = unknown> = {
|
|
23
|
+
Allows: TraverseAllows<input>;
|
|
24
|
+
Apply: TraverseApply<input>;
|
|
25
|
+
};
|
|
26
|
+
export type TraversalKind = keyof TraversalMethodsByKind;
|
|
27
|
+
export type TraverseAllows<data = unknown> = (data: data, ctx: TraversalContext) => boolean;
|
|
28
|
+
export type TraverseApply<data = unknown> = (data: data, ctx: TraversalContext) => void;
|
|
29
|
+
//# sourceMappingURL=context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../shared/context.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,KAAK,aAAa,EAAE,MAAM,aAAa,CAAA;AAC3D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAExD,MAAM,MAAM,aAAa,GAAG,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAA;AAE/C,eAAO,MAAM,gBAAgB,iCAM5B,CAAA;AAED,qBAAa,gBAAgB;IAUpB,IAAI,EAAE,OAAO;IACb,MAAM,EAAE,eAAe;IAV/B,IAAI,EAAE,aAAa,CAAK;IACxB,WAAW,EAAE,SAAS,EAAE,CAAA;IAExB,cAAc,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,EAAE,MAAM,CAAC,EAAE,CAAK;IAGnE,IAAI,EAAE;SAAG,IAAI,IAAI,MAAM,CAAC,CAAC,EAAE,MAAM,EAAE;KAAE,CAAK;gBAGlC,IAAI,EAAE,OAAO,EACb,MAAM,EAAE,eAAe;IAK/B,IAAI,aAAa,cAEhB;IAED,IAAI,KAAK,sPAER;IAED,IAAI,IAAI,IAAI,OAAO,CAMlB;IAED,OAAO,CAAC,KAAK,EAAE,aAAa,GAAG,KAAK;IAKpC,SAAS;IAIT,QAAQ,CAAC,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE;CAM3D;AAED,MAAM,MAAM,sBAAsB,CAAC,KAAK,GAAG,OAAO,IAAI;IACrD,MAAM,EAAE,cAAc,CAAC,KAAK,CAAC,CAAA;IAC7B,KAAK,EAAE,aAAa,CAAC,KAAK,CAAC,CAAA;CAC3B,CAAA;AAED,MAAM,MAAM,aAAa,GAAG,MAAM,sBAAsB,CAAA;AAExD,MAAM,MAAM,cAAc,CAAC,IAAI,GAAG,OAAO,IAAI,CAC5C,IAAI,EAAE,IAAI,EACV,GAAG,EAAE,gBAAgB,KACjB,OAAO,CAAA;AACZ,MAAM,MAAM,aAAa,CAAC,IAAI,GAAG,OAAO,IAAI,CAC3C,IAAI,EAAE,IAAI,EACV,GAAG,EAAE,gBAAgB,KACjB,IAAI,CAAA"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { literalPropAccess } from "@arktype/util";
|
|
2
|
+
import { ArkErrors } from "./errors.js";
|
|
3
|
+
export const pathToPropString = (path) => {
|
|
4
|
+
const propAccessChain = path.reduce((s, segment) => s + literalPropAccess(segment), "");
|
|
5
|
+
return propAccessChain[0] === "." ? propAccessChain.slice(1) : propAccessChain;
|
|
6
|
+
};
|
|
7
|
+
export class TraversalContext {
|
|
8
|
+
root;
|
|
9
|
+
config;
|
|
10
|
+
path = [];
|
|
11
|
+
errorsStack;
|
|
12
|
+
// TODO: add morphs here
|
|
13
|
+
entriesToPrune = [];
|
|
14
|
+
// Qualified
|
|
15
|
+
seen = {};
|
|
16
|
+
constructor(root, config) {
|
|
17
|
+
this.root = root;
|
|
18
|
+
this.config = config;
|
|
19
|
+
this.errorsStack = [new ArkErrors(this)];
|
|
20
|
+
}
|
|
21
|
+
get currentErrors() {
|
|
22
|
+
return this.errorsStack.at(-1);
|
|
23
|
+
}
|
|
24
|
+
get error() {
|
|
25
|
+
return this.currentErrors.add.bind(this.currentErrors);
|
|
26
|
+
}
|
|
27
|
+
get data() {
|
|
28
|
+
let result = this.root;
|
|
29
|
+
for (const segment of this.path) {
|
|
30
|
+
result = result?.[segment];
|
|
31
|
+
}
|
|
32
|
+
return result;
|
|
33
|
+
}
|
|
34
|
+
invalid(input) {
|
|
35
|
+
this.error(input);
|
|
36
|
+
return false;
|
|
37
|
+
}
|
|
38
|
+
pushUnion() {
|
|
39
|
+
this.errorsStack.push(new ArkErrors(this));
|
|
40
|
+
}
|
|
41
|
+
popUnion(branchCount, data, path) {
|
|
42
|
+
const branchProblems = this.errorsStack.pop();
|
|
43
|
+
if (branchProblems.count === branchCount) {
|
|
44
|
+
// this.addError("union", { data: this.data, errors: branchProblems })
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../shared/context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAAE,SAAS,EAAsB,MAAM,aAAa,CAAA;AAK3D,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,IAAmB,EAAE,EAAE;IACvD,MAAM,eAAe,GAAG,IAAI,CAAC,MAAM,CAClC,CAAC,CAAC,EAAE,OAAO,EAAE,EAAE,CAAC,CAAC,GAAG,iBAAiB,CAAC,OAAO,CAAC,EAC9C,EAAE,CACF,CAAA;IACD,OAAO,eAAe,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,eAAe,CAAC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,CAAC,KAAK,KAAK,WAAW,EAAE,CAAC;YAC1C,sEAAsE;QACvE,CAAC;IACF,CAAC;CACD"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { evaluate, merge } from "@arktype/util";
|
|
2
|
+
import type { NarrowedAttachments, Node } from "../base.js";
|
|
3
|
+
import type { reducibleKindOf } from "../kinds.js";
|
|
4
|
+
import type { Disjoint } from "./disjoint.js";
|
|
5
|
+
import type { NodeKind } from "./implement.js";
|
|
6
|
+
export interface BaseMeta {
|
|
7
|
+
readonly description?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const metaKeys: {
|
|
10
|
+
[k in keyof BaseMeta]: 1;
|
|
11
|
+
};
|
|
12
|
+
interface DeclarationInput {
|
|
13
|
+
kind: NodeKind;
|
|
14
|
+
schema: unknown;
|
|
15
|
+
normalizedSchema: BaseMeta;
|
|
16
|
+
inner: BaseMeta;
|
|
17
|
+
reducibleTo?: NodeKind;
|
|
18
|
+
intersectionIsOpen?: true;
|
|
19
|
+
errorContext?: object;
|
|
20
|
+
prerequisite?: unknown;
|
|
21
|
+
childKind?: NodeKind;
|
|
22
|
+
}
|
|
23
|
+
export interface BaseErrorContext<kind extends NodeKind = NodeKind> {
|
|
24
|
+
code: kind;
|
|
25
|
+
}
|
|
26
|
+
export type defaultErrorContext<d extends DeclarationInput> = evaluate<BaseErrorContext<d["kind"]> & d["inner"]>;
|
|
27
|
+
export type declareNode<d extends {
|
|
28
|
+
[k in keyof d]: k extends keyof DeclarationInput ? DeclarationInput[k] : never;
|
|
29
|
+
} & DeclarationInput> = merge<{
|
|
30
|
+
intersectionIsOpen: false;
|
|
31
|
+
prerequisite: prerequisiteOf<d>;
|
|
32
|
+
childKind: never;
|
|
33
|
+
reducibleTo: d["kind"];
|
|
34
|
+
errorContext: null;
|
|
35
|
+
}, d & {
|
|
36
|
+
errorContext: d["errorContext"] extends {} ? BaseErrorContext<d["kind"]> : null;
|
|
37
|
+
}>;
|
|
38
|
+
type prerequisiteOf<d extends DeclarationInput> = "prerequisite" extends keyof d ? d["prerequisite"] : unknown;
|
|
39
|
+
export type BaseAttachmentsOf<d extends BaseNodeDeclaration> = NarrowedAttachments<d> & d["inner"];
|
|
40
|
+
export type BaseNodeDeclaration = {
|
|
41
|
+
kind: NodeKind;
|
|
42
|
+
schema: unknown;
|
|
43
|
+
normalizedSchema: BaseMeta;
|
|
44
|
+
inner: BaseMeta;
|
|
45
|
+
reducibleTo: NodeKind;
|
|
46
|
+
prerequisite: any;
|
|
47
|
+
intersectionIsOpen: boolean;
|
|
48
|
+
childKind: NodeKind;
|
|
49
|
+
errorContext: BaseErrorContext | null;
|
|
50
|
+
};
|
|
51
|
+
export type ownIntersectionResult<d extends BaseNodeDeclaration> = Node<reducibleKindOf<d["kind"]>> | Disjoint;
|
|
52
|
+
export {};
|
|
53
|
+
//# sourceMappingURL=declare.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"declare.d.ts","sourceRoot":"","sources":["../../shared/declare.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AACpD,OAAO,KAAK,EAAE,mBAAmB,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AAC3D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAClD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAC7C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAE9C,MAAM,WAAW,QAAQ;IACxB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAC7B;AAED,eAAO,MAAM,QAAQ,EAAE;KAAG,CAAC,IAAI,MAAM,QAAQ,GAAG,CAAC;CAAuB,CAAA;AAExE,UAAU,gBAAgB;IACzB,IAAI,EAAE,QAAQ,CAAA;IACd,MAAM,EAAE,OAAO,CAAA;IACf,gBAAgB,EAAE,QAAQ,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