arktype 2.0.0-dev.4 → 2.0.0-dev.6
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 +176 -236
- package/__tests__/badDefinitionType.test.ts +10 -3
- package/__tests__/basis.test.ts +6 -2
- package/__tests__/bounds.test.ts +282 -352
- package/__tests__/cast.test.ts +7 -2
- package/__tests__/completions.test.ts +8 -3
- package/__tests__/config.test.ts +16 -8
- package/__tests__/cyclic.test.ts +141 -137
- package/__tests__/dateLiteral.test.ts +8 -4
- package/__tests__/declared.test.ts +2 -2
- package/__tests__/discrimination.test.ts +1 -1
- package/__tests__/divisor.test.ts +45 -25
- package/__tests__/enclosed.test.ts +39 -25
- package/__tests__/examples.test.ts +56 -56
- package/__tests__/expressions.test.ts +184 -112
- package/__tests__/generic.test.ts +307 -288
- package/__tests__/group.test.ts +67 -54
- package/__tests__/imports.test.ts +44 -37
- package/__tests__/instanceof.test.ts +17 -15
- package/__tests__/intersection.test.ts +50 -46
- package/__tests__/keyTraversal.test.ts +6 -3
- package/__tests__/keyof.test.ts +68 -52
- package/__tests__/keywords.test.ts +149 -136
- package/__tests__/literal.test.ts +38 -15
- package/__tests__/match.test.ts +234 -224
- package/__tests__/morph.test.ts +300 -269
- package/__tests__/narrow.test.ts +46 -42
- package/__tests__/objectLiteral.test.ts +228 -210
- package/__tests__/realWorld.test.ts +63 -0
- package/__tests__/regex.test.ts +17 -7
- package/__tests__/scope.bench.ts +1 -1
- package/__tests__/scope.test.ts +65 -18
- package/__tests__/serialization.test.ts +19 -0
- package/__tests__/string.test.ts +11 -7
- package/__tests__/submodule.test.ts +26 -39
- package/__tests__/this.test.ts +83 -57
- package/__tests__/thunk.test.ts +13 -7
- package/__tests__/traverse.test.ts +50 -37
- package/__tests__/tsGenerics.test.ts +12 -12
- package/__tests__/type.test.ts +38 -0
- package/__tests__/typeReference.test.ts +7 -7
- package/__tests__/unenclosed.test.ts +116 -100
- package/__tests__/union.test.ts +171 -104
- package/ark.ts +18 -65
- package/generic.ts +67 -0
- package/main.ts +6 -18
- package/match.ts +53 -67
- package/module.ts +15 -0
- package/out/ark.d.ts +12 -36
- package/out/ark.d.ts.map +1 -1
- package/out/ark.js +9 -17
- package/out/ark.js.map +1 -1
- package/out/base.d.ts +205 -0
- package/out/base.d.ts.map +1 -0
- package/out/base.js +320 -0
- package/out/base.js.map +1 -0
- package/out/builtins/builtins.d.ts +23 -0
- package/out/builtins/builtins.d.ts.map +1 -0
- package/out/builtins/builtins.js +15 -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 +18 -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 +62 -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 +23 -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 +35 -0
- package/out/builtins/utils/creditCard.js.map +1 -0
- package/out/builtins/utils/date.d.ts +41 -0
- package/out/builtins/utils/date.d.ts.map +1 -0
- package/out/builtins/utils/date.js +56 -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 +74 -0
- package/out/builtins/validation.js.map +1 -0
- package/out/config.d.ts +9 -0
- package/out/config.d.ts.map +1 -0
- package/out/config.js +18 -0
- package/out/config.js.map +1 -0
- package/out/constraints/ast.d.ts +287 -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 +200 -0
- package/out/constraints/constraint.d.ts.map +1 -0
- package/out/constraints/constraint.js +25 -0
- package/out/constraints/constraint.js.map +1 -0
- package/out/constraints/predicate.d.ts +64 -0
- package/out/constraints/predicate.d.ts.map +1 -0
- package/out/constraints/predicate.js +52 -0
- package/out/constraints/predicate.js.map +1 -0
- package/out/constraints/props/index.d.ts +42 -0
- package/out/constraints/props/index.d.ts.map +1 -0
- package/out/constraints/props/index.js +56 -0
- package/out/constraints/props/index.js.map +1 -0
- package/out/constraints/props/optional.d.ts +37 -0
- package/out/constraints/props/optional.d.ts.map +1 -0
- package/out/constraints/props/optional.js +56 -0
- package/out/constraints/props/optional.js.map +1 -0
- package/out/constraints/props/prop.d.ts +49 -0
- package/out/constraints/props/prop.d.ts.map +1 -0
- package/out/constraints/props/prop.js +106 -0
- package/out/constraints/props/prop.js.map +1 -0
- package/out/constraints/props/props.d.ts +37 -0
- package/out/constraints/props/props.d.ts.map +1 -0
- package/out/constraints/props/props.js +121 -0
- package/out/constraints/props/props.js.map +1 -0
- package/out/constraints/props/required.d.ts +46 -0
- package/out/constraints/props/required.d.ts.map +1 -0
- package/out/constraints/props/required.js +81 -0
- package/out/constraints/props/required.js.map +1 -0
- package/out/constraints/props/sequence.d.ts +82 -0
- package/out/constraints/props/sequence.d.ts.map +1 -0
- package/out/constraints/props/sequence.js +376 -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 +33 -0
- package/out/constraints/refinements/after.d.ts.map +1 -0
- package/out/constraints/refinements/after.js +36 -0
- package/out/constraints/refinements/after.js.map +1 -0
- package/out/constraints/refinements/before.d.ts +33 -0
- package/out/constraints/refinements/before.d.ts.map +1 -0
- package/out/constraints/refinements/before.js +43 -0
- package/out/constraints/refinements/before.js.map +1 -0
- package/out/constraints/refinements/divisor.d.ts +52 -0
- package/out/constraints/refinements/divisor.d.ts.map +1 -0
- package/out/constraints/refinements/divisor.js +52 -0
- package/out/constraints/refinements/divisor.js.map +1 -0
- package/out/constraints/refinements/exactLength.d.ts +45 -0
- package/out/constraints/refinements/exactLength.d.ts.map +1 -0
- package/out/constraints/refinements/exactLength.js +52 -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 +48 -0
- package/out/constraints/refinements/length.d.ts.map +1 -0
- package/out/constraints/refinements/length.js +53 -0
- package/out/constraints/refinements/length.js.map +1 -0
- package/out/constraints/refinements/max.d.ts +31 -0
- package/out/constraints/refinements/max.d.ts.map +1 -0
- package/out/constraints/refinements/max.js +35 -0
- package/out/constraints/refinements/max.js.map +1 -0
- package/out/constraints/refinements/maxLength.d.ts +32 -0
- package/out/constraints/refinements/maxLength.d.ts.map +1 -0
- package/out/constraints/refinements/maxLength.js +36 -0
- package/out/constraints/refinements/maxLength.js.map +1 -0
- package/out/constraints/refinements/min.d.ts +31 -0
- package/out/constraints/refinements/min.d.ts.map +1 -0
- package/out/constraints/refinements/min.js +28 -0
- package/out/constraints/refinements/min.js.map +1 -0
- package/out/constraints/refinements/minLength.d.ts +32 -0
- package/out/constraints/refinements/minLength.d.ts.map +1 -0
- package/out/constraints/refinements/minLength.js +33 -0
- package/out/constraints/refinements/minLength.js.map +1 -0
- package/out/constraints/refinements/range.d.ts +119 -0
- package/out/constraints/refinements/range.d.ts.map +1 -0
- package/out/constraints/refinements/range.js +89 -0
- package/out/constraints/refinements/range.js.map +1 -0
- package/out/constraints/refinements/regex.d.ts +47 -0
- package/out/constraints/refinements/regex.d.ts.map +1 -0
- package/out/constraints/refinements/regex.js +37 -0
- package/out/constraints/refinements/regex.js.map +1 -0
- package/out/constraints/refinements/shared.d.ts +20 -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/generic.d.ts +22 -0
- package/out/generic.d.ts.map +1 -0
- package/out/generic.js +23 -0
- package/out/generic.js.map +1 -0
- package/out/inference.d.ts +137 -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 +70 -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 +13 -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 +18 -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 +64 -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 +25 -0
- package/out/keywords/tsPrimitive.js.map +1 -0
- package/out/keywords/utils/creditCard.d.ts +11 -0
- package/out/keywords/utils/creditCard.d.ts.map +1 -0
- package/out/keywords/utils/creditCard.js +35 -0
- package/out/keywords/utils/creditCard.js.map +1 -0
- package/out/keywords/utils/date.d.ts +45 -0
- package/out/keywords/utils/date.d.ts.map +1 -0
- package/out/keywords/utils/date.js +56 -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 +80 -0
- package/out/keywords/validation.js.map +1 -0
- package/out/kinds.d.ts +102 -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 +6 -6
- package/out/main.d.ts.map +1 -1
- package/out/main.js +4 -3
- package/out/main.js.map +1 -1
- package/out/match.d.ts +18 -23
- package/out/match.d.ts.map +1 -1
- package/out/match.js +3 -4
- package/out/match.js.map +1 -1
- package/out/module.d.ts +11 -0
- package/out/module.d.ts.map +1 -0
- package/out/module.js +4 -0
- package/out/module.js.map +1 -0
- package/out/parse.d.ts +29 -0
- package/out/parse.d.ts.map +1 -0
- package/out/parse.js +161 -0
- package/out/parse.js.map +1 -0
- package/out/parser/definition.d.ts +9 -12
- package/out/parser/definition.d.ts.map +1 -1
- package/out/parser/definition.js +10 -12
- package/out/parser/definition.js.map +1 -1
- package/out/parser/generic.d.ts +3 -4
- package/out/parser/generic.d.ts.map +1 -1
- package/out/parser/generic.js +6 -8
- package/out/parser/generic.js.map +1 -1
- package/out/parser/objectLiteral.d.ts +44 -12
- package/out/parser/objectLiteral.d.ts.map +1 -1
- package/out/parser/objectLiteral.js +43 -36
- package/out/parser/objectLiteral.js.map +1 -1
- package/out/parser/semantic/bounds.d.ts +9 -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 +5 -6
- package/out/parser/semantic/divisor.d.ts.map +1 -1
- package/out/parser/semantic/infer.d.ts +25 -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 +14 -12
- package/out/parser/semantic/validate.d.ts.map +1 -1
- package/out/parser/semantic/validate.js +1 -0
- package/out/parser/semantic/validate.js.map +1 -1
- package/out/parser/string/reduce/dynamic.d.ts +13 -12
- package/out/parser/string/reduce/dynamic.d.ts.map +1 -1
- package/out/parser/string/reduce/dynamic.js +27 -17
- package/out/parser/string/reduce/dynamic.js.map +1 -1
- package/out/parser/string/reduce/shared.d.ts +1 -2
- 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 +26 -22
- package/out/parser/string/reduce/static.d.ts.map +1 -1
- package/out/parser/string/shift/operand/date.d.ts +2 -1
- package/out/parser/string/shift/operand/date.d.ts.map +1 -1
- package/out/parser/string/shift/operand/date.js +2 -2
- package/out/parser/string/shift/operand/date.js.map +1 -1
- package/out/parser/string/shift/operand/enclosed.d.ts +2 -2
- 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 +9 -9
- package/out/parser/string/shift/operand/genericArgs.d.ts.map +1 -1
- package/out/parser/string/shift/operand/genericArgs.js +6 -8
- package/out/parser/string/shift/operand/genericArgs.js.map +1 -1
- package/out/parser/string/shift/operand/operand.d.ts +3 -3
- package/out/parser/string/shift/operand/operand.d.ts.map +1 -1
- package/out/parser/string/shift/operand/operand.js +8 -11
- package/out/parser/string/shift/operand/operand.js.map +1 -1
- package/out/parser/string/shift/operand/unenclosed.d.ts +13 -20
- package/out/parser/string/shift/operand/unenclosed.d.ts.map +1 -1
- package/out/parser/string/shift/operand/unenclosed.js +21 -26
- package/out/parser/string/shift/operand/unenclosed.js.map +1 -1
- package/out/parser/string/shift/operator/bounds.d.ts +15 -12
- package/out/parser/string/shift/operator/bounds.d.ts.map +1 -1
- package/out/parser/string/shift/operator/bounds.js +42 -48
- package/out/parser/string/shift/operator/bounds.js.map +1 -1
- package/out/parser/string/shift/operator/divisor.d.ts +1 -2
- 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/operator/operator.d.ts +1 -1
- package/out/parser/string/shift/operator/operator.d.ts.map +1 -1
- package/out/parser/string/shift/operator/operator.js +12 -18
- package/out/parser/string/shift/operator/operator.js.map +1 -1
- package/out/parser/string/shift/scanner.d.ts +2 -1
- package/out/parser/string/shift/scanner.d.ts.map +1 -1
- package/out/parser/string/shift/scanner.js +12 -11
- package/out/parser/string/shift/scanner.js.map +1 -1
- package/out/parser/string/string.d.ts +8 -5
- 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 +96 -37
- package/out/parser/tuple.d.ts.map +1 -1
- package/out/parser/tuple.js +61 -66
- package/out/parser/tuple.js.map +1 -1
- package/out/schema.d.ts +175 -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 +180 -0
- package/out/schemaScope.d.ts.map +1 -0
- package/out/schemaScope.js +235 -0
- package/out/schemaScope.js.map +1 -0
- package/out/scope.d.ts +42 -114
- package/out/scope.d.ts.map +1 -1
- package/out/scope.js +51 -181
- 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 +79 -0
- package/out/shared/compile.js.map +1 -0
- package/out/shared/context.d.ts +54 -0
- package/out/shared/context.d.ts.map +1 -0
- package/out/shared/context.js +53 -0
- package/out/shared/context.js.map +1 -0
- package/out/shared/declare.d.ts +69 -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 +91 -0
- package/out/shared/disjoint.d.ts.map +1 -0
- package/out/shared/disjoint.js +110 -0
- package/out/shared/disjoint.js.map +1 -0
- package/out/shared/errors.d.ts +99 -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 +363 -0
- package/out/shared/implement.d.ts.map +1 -0
- package/out/shared/implement.js +68 -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 +60 -0
- package/out/shared/intersections.d.ts.map +1 -0
- package/out/shared/intersections.js +2 -0
- package/out/shared/intersections.js.map +1 -0
- package/out/shared/traversal.d.ts +62 -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 +24 -0
- package/out/shared/utils.d.ts.map +1 -0
- package/out/shared/utils.js +15 -0
- package/out/shared/utils.js.map +1 -0
- package/out/type.d.ts +23 -59
- package/out/type.d.ts.map +1 -1
- package/out/type.js +2 -137
- package/out/type.js.map +1 -1
- package/out/types/basis.d.ts +47 -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 +34 -0
- package/out/types/discriminate.d.ts.map +1 -0
- package/out/types/discriminate.js +120 -0
- package/out/types/discriminate.js.map +1 -0
- package/out/types/domain.d.ts +57 -0
- package/out/types/domain.d.ts.map +1 -0
- package/out/types/domain.js +41 -0
- package/out/types/domain.js.map +1 -0
- package/out/types/intersection.d.ts +127 -0
- package/out/types/intersection.d.ts.map +1 -0
- package/out/types/intersection.js +379 -0
- package/out/types/intersection.js.map +1 -0
- package/out/types/morph.d.ts +157 -0
- package/out/types/morph.d.ts.map +1 -0
- package/out/types/morph.js +99 -0
- package/out/types/morph.js.map +1 -0
- package/out/types/proto.d.ts +51 -0
- package/out/types/proto.d.ts.map +1 -0
- package/out/types/proto.js +60 -0
- package/out/types/proto.js.map +1 -0
- package/out/types/type.d.ts +143 -0
- package/out/types/type.d.ts.map +1 -0
- package/out/types/type.js +123 -0
- package/out/types/type.js.map +1 -0
- package/out/types/union.d.ts +71 -0
- package/out/types/union.d.ts.map +1 -0
- package/out/types/union.js +379 -0
- package/out/types/union.js.map +1 -0
- package/out/types/unit.d.ts +45 -0
- package/out/types/unit.d.ts.map +1 -0
- package/out/types/unit.js +56 -0
- package/out/types/unit.js.map +1 -0
- package/out/util.d.ts +30 -18
- package/out/util.d.ts.map +1 -1
- package/out/util.js +8 -7
- package/out/util.js.map +1 -1
- package/package.json +7 -3
- package/parser/definition.ts +73 -89
- package/parser/generic.ts +35 -36
- package/parser/objectLiteral.ts +143 -117
- package/parser/semantic/bounds.ts +33 -32
- package/parser/semantic/divisor.ts +8 -10
- package/parser/semantic/infer.ts +141 -0
- package/parser/semantic/utils.ts +12 -23
- package/parser/semantic/validate.ts +82 -73
- package/parser/string/reduce/dynamic.ts +61 -46
- package/parser/string/reduce/shared.ts +1 -3
- package/parser/string/reduce/static.ts +65 -67
- package/parser/string/shift/operand/date.ts +12 -8
- package/parser/string/shift/operand/enclosed.ts +22 -17
- package/parser/string/shift/operand/genericArgs.ts +46 -45
- package/parser/string/shift/operand/operand.ts +32 -38
- package/parser/string/shift/operand/unenclosed.ts +106 -147
- package/parser/string/shift/operator/bounds.ts +114 -106
- package/parser/string/shift/operator/divisor.ts +12 -14
- package/parser/string/shift/operator/operator.ts +35 -46
- package/parser/string/shift/scanner.ts +49 -46
- package/parser/string/string.ts +28 -32
- package/parser/tuple.ts +288 -308
- package/scope.ts +183 -425
- package/type.ts +82 -281
- package/__tests__/astUtils.test.ts +0 -17
- package/__tests__/jsdoc.test.ts +0 -64
- package/__tests__/nodeDefinitions.test.ts +0 -190
- package/__tests__/typeMethods.test.ts +0 -69
- 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 +0 -2
- 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/util.ts +0 -36
|
@@ -0,0 +1,379 @@
|
|
|
1
|
+
import {
|
|
2
|
+
append,
|
|
3
|
+
appendUnique,
|
|
4
|
+
conflatenateAll,
|
|
5
|
+
entriesOf,
|
|
6
|
+
isArray,
|
|
7
|
+
isEmptyObject,
|
|
8
|
+
omit,
|
|
9
|
+
pick,
|
|
10
|
+
splitByKeys,
|
|
11
|
+
throwInternalError
|
|
12
|
+
} from "@arktype/util"
|
|
13
|
+
import { BaseNode } from "../base.js"
|
|
14
|
+
import { PropsGroup } from "../constraints/props/props.js"
|
|
15
|
+
import { metaKeys } from "../shared/declare.js"
|
|
16
|
+
import { Disjoint } from "../shared/disjoint.js"
|
|
17
|
+
import { constraintKeys, propKeys } from "../shared/implement.js"
|
|
18
|
+
import { BaseType, defineRightwardIntersections } from "./type.js"
|
|
19
|
+
const intersectionChildKeyParser = (kind) => (input, ctx) => {
|
|
20
|
+
if (isArray(input)) {
|
|
21
|
+
if (input.length === 0) {
|
|
22
|
+
// Omit empty lists as input
|
|
23
|
+
return
|
|
24
|
+
}
|
|
25
|
+
return input
|
|
26
|
+
.map((schema) => ctx.$.node(kind, schema))
|
|
27
|
+
.sort((l, r) => (l.innerId < r.innerId ? -1 : 1))
|
|
28
|
+
}
|
|
29
|
+
const node = ctx.$.node(kind, input)
|
|
30
|
+
return node.intersectionIsOpen ? [node] : node
|
|
31
|
+
}
|
|
32
|
+
// readonly literalKeys = this.named.map((prop) => prop.key.name)
|
|
33
|
+
// readonly namedKeyOf = cached(() => node.unit(...this.literalKeys))
|
|
34
|
+
// readonly indexedKeyOf = cached(
|
|
35
|
+
// () =>
|
|
36
|
+
// new Type(
|
|
37
|
+
// this.indexed.flatMap((entry) => entry.key.branches),
|
|
38
|
+
// this.meta
|
|
39
|
+
// )
|
|
40
|
+
// )
|
|
41
|
+
// readonly keyof = cached(() => this.namedKeyOf().or(this.indexedKeyOf()))
|
|
42
|
+
// get(key: string | Type) {
|
|
43
|
+
// return typeof key === "string"
|
|
44
|
+
// ? this.named.find((entry) => entry.value.branches)?.value
|
|
45
|
+
// : this.indexed.find((entry) => entry.key.equals(key))?.value
|
|
46
|
+
// }
|
|
47
|
+
const intersectIntersections = (reduced, raw, $) => {
|
|
48
|
+
// avoid treating adding instance keys as keys of lRoot, rRoot
|
|
49
|
+
if (reduced instanceof IntersectionNode) reduced = reduced.inner
|
|
50
|
+
if (raw instanceof IntersectionNode) raw = raw.inner
|
|
51
|
+
const [reducedConstraintsInner, reducedRoot] = splitByKeys(
|
|
52
|
+
reduced,
|
|
53
|
+
constraintKeys
|
|
54
|
+
)
|
|
55
|
+
const [rawConstraintsInner, rawRoot] = splitByKeys(raw, constraintKeys)
|
|
56
|
+
// since intersection with a left operand of unknown is leveraged for
|
|
57
|
+
// reduction, check for the case where r is empty so we can preserve
|
|
58
|
+
// metadata and save some time
|
|
59
|
+
const root = isEmptyObject(reduced)
|
|
60
|
+
? rawRoot
|
|
61
|
+
: intersectRootKeys(reducedRoot, rawRoot)
|
|
62
|
+
if (root instanceof Disjoint) return root
|
|
63
|
+
const lConstraints = flattenConstraints(reducedConstraintsInner)
|
|
64
|
+
const rConstraints = flattenConstraints(rawConstraintsInner)
|
|
65
|
+
return intersectConstraints({
|
|
66
|
+
root,
|
|
67
|
+
l: lConstraints,
|
|
68
|
+
r: rConstraints,
|
|
69
|
+
types: [],
|
|
70
|
+
$
|
|
71
|
+
})
|
|
72
|
+
}
|
|
73
|
+
export class IntersectionNode extends BaseType {
|
|
74
|
+
static implementation = this.implement({
|
|
75
|
+
hasAssociatedError: true,
|
|
76
|
+
normalize: (schema) => schema,
|
|
77
|
+
keys: {
|
|
78
|
+
domain: {
|
|
79
|
+
child: true,
|
|
80
|
+
parse: intersectionChildKeyParser("domain")
|
|
81
|
+
},
|
|
82
|
+
proto: {
|
|
83
|
+
child: true,
|
|
84
|
+
parse: intersectionChildKeyParser("proto")
|
|
85
|
+
},
|
|
86
|
+
divisor: {
|
|
87
|
+
child: true,
|
|
88
|
+
parse: intersectionChildKeyParser("divisor")
|
|
89
|
+
},
|
|
90
|
+
max: {
|
|
91
|
+
child: true,
|
|
92
|
+
parse: intersectionChildKeyParser("max")
|
|
93
|
+
},
|
|
94
|
+
min: {
|
|
95
|
+
child: true,
|
|
96
|
+
parse: intersectionChildKeyParser("min")
|
|
97
|
+
},
|
|
98
|
+
maxLength: {
|
|
99
|
+
child: true,
|
|
100
|
+
parse: intersectionChildKeyParser("maxLength")
|
|
101
|
+
},
|
|
102
|
+
minLength: {
|
|
103
|
+
child: true,
|
|
104
|
+
parse: intersectionChildKeyParser("minLength")
|
|
105
|
+
},
|
|
106
|
+
exactLength: {
|
|
107
|
+
child: true,
|
|
108
|
+
parse: intersectionChildKeyParser("exactLength")
|
|
109
|
+
},
|
|
110
|
+
before: {
|
|
111
|
+
child: true,
|
|
112
|
+
parse: intersectionChildKeyParser("before")
|
|
113
|
+
},
|
|
114
|
+
after: {
|
|
115
|
+
child: true,
|
|
116
|
+
parse: intersectionChildKeyParser("after")
|
|
117
|
+
},
|
|
118
|
+
regex: {
|
|
119
|
+
child: true,
|
|
120
|
+
parse: intersectionChildKeyParser("regex")
|
|
121
|
+
},
|
|
122
|
+
predicate: {
|
|
123
|
+
child: true,
|
|
124
|
+
parse: intersectionChildKeyParser("predicate")
|
|
125
|
+
},
|
|
126
|
+
prop: {
|
|
127
|
+
child: true,
|
|
128
|
+
parse: intersectionChildKeyParser("prop")
|
|
129
|
+
},
|
|
130
|
+
index: {
|
|
131
|
+
child: true,
|
|
132
|
+
parse: intersectionChildKeyParser("index")
|
|
133
|
+
},
|
|
134
|
+
sequence: {
|
|
135
|
+
child: true,
|
|
136
|
+
parse: intersectionChildKeyParser("sequence")
|
|
137
|
+
},
|
|
138
|
+
onExtraneousKey: {
|
|
139
|
+
parse: (def) => (def === "ignore" ? undefined : def)
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
// leverage reduction logic from intersection and identity to ensure initial
|
|
143
|
+
// parse result is reduced
|
|
144
|
+
reduce: (inner, $) =>
|
|
145
|
+
// we cast union out of the result here since that only occurs when intersecting two sequences
|
|
146
|
+
// that cannot occur when reducing a single intersection schema using unknown
|
|
147
|
+
intersectIntersections({}, inner, $),
|
|
148
|
+
defaults: {
|
|
149
|
+
description(node) {
|
|
150
|
+
return node.children.length === 0
|
|
151
|
+
? "unknown"
|
|
152
|
+
: node.props?.description ??
|
|
153
|
+
node.children
|
|
154
|
+
.map((child) => child.description)
|
|
155
|
+
.join(" and ")
|
|
156
|
+
},
|
|
157
|
+
expected(source) {
|
|
158
|
+
return (
|
|
159
|
+
" • " + source.errors.map((e) => e.expected).join("\n • ")
|
|
160
|
+
)
|
|
161
|
+
},
|
|
162
|
+
problem(ctx) {
|
|
163
|
+
return `must be...\n${ctx.expected}`
|
|
164
|
+
}
|
|
165
|
+
},
|
|
166
|
+
intersections: {
|
|
167
|
+
intersection: intersectIntersections,
|
|
168
|
+
...defineRightwardIntersections("intersection", (l, r, $) => {
|
|
169
|
+
// if l is unknown, return r
|
|
170
|
+
if (l.children.length === 0) return r
|
|
171
|
+
const basis = l.basis?.intersect(r) ?? r
|
|
172
|
+
return basis instanceof Disjoint
|
|
173
|
+
? basis
|
|
174
|
+
: l?.basis?.equals(basis)
|
|
175
|
+
? // if the basis doesn't change, return the original intesection
|
|
176
|
+
l
|
|
177
|
+
: // given we've already precluded l being unknown, the result must
|
|
178
|
+
// be an intersection with the new basis result integrated
|
|
179
|
+
$.node(
|
|
180
|
+
"intersection",
|
|
181
|
+
Object.assign(omit(l.inner, metaKeys), {
|
|
182
|
+
[basis.kind]: basis
|
|
183
|
+
}),
|
|
184
|
+
{ prereduced: true }
|
|
185
|
+
)
|
|
186
|
+
})
|
|
187
|
+
}
|
|
188
|
+
})
|
|
189
|
+
basis = this.domain ?? this.proto
|
|
190
|
+
refinements = this.children.filter((node) => node.isRefinement())
|
|
191
|
+
props = maybeCreatePropsGroup(this.inner, this.$)
|
|
192
|
+
traversables = conflatenateAll(
|
|
193
|
+
this.basis,
|
|
194
|
+
this.refinements,
|
|
195
|
+
this.props,
|
|
196
|
+
this.predicate
|
|
197
|
+
)
|
|
198
|
+
expression =
|
|
199
|
+
this.props?.expression ||
|
|
200
|
+
this.children.map((node) => node.nestableExpression).join(" & ") ||
|
|
201
|
+
"unknown"
|
|
202
|
+
traverseAllows = (data, ctx) =>
|
|
203
|
+
this.traversables.every((traversable) =>
|
|
204
|
+
traversable.traverseAllows(data, ctx)
|
|
205
|
+
)
|
|
206
|
+
traverseApply = (data, ctx) => {
|
|
207
|
+
if (this.basis) {
|
|
208
|
+
this.basis.traverseApply(data, ctx)
|
|
209
|
+
if (ctx.hasError()) return
|
|
210
|
+
}
|
|
211
|
+
if (this.refinements.length) {
|
|
212
|
+
for (let i = 0; i < this.refinements.length - 1; i++) {
|
|
213
|
+
this.refinements[i].traverseApply(data, ctx)
|
|
214
|
+
if (ctx.failFast && ctx.hasError()) return
|
|
215
|
+
}
|
|
216
|
+
this.refinements.at(-1).traverseApply(data, ctx)
|
|
217
|
+
if (ctx.hasError()) return
|
|
218
|
+
}
|
|
219
|
+
if (this.props) {
|
|
220
|
+
this.props.traverseApply(data, ctx)
|
|
221
|
+
if (ctx.hasError()) return
|
|
222
|
+
}
|
|
223
|
+
if (this.predicate) {
|
|
224
|
+
for (let i = 0; i < this.predicate.length - 1; i++) {
|
|
225
|
+
this.predicate[i].traverseApply(data, ctx)
|
|
226
|
+
if (ctx.failFast && ctx.hasError()) return
|
|
227
|
+
}
|
|
228
|
+
this.predicate.at(-1).traverseApply(data, ctx)
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
compile(js) {
|
|
232
|
+
if (js.traversalKind === "Allows") {
|
|
233
|
+
this.traversables.forEach((traversable) =>
|
|
234
|
+
traversable instanceof BaseNode
|
|
235
|
+
? js.check(traversable)
|
|
236
|
+
: traversable.compile(js)
|
|
237
|
+
)
|
|
238
|
+
js.return(true)
|
|
239
|
+
return
|
|
240
|
+
}
|
|
241
|
+
const returnIfFail = () => js.if("ctx.hasError()", () => js.return())
|
|
242
|
+
const returnIfFailFast = () =>
|
|
243
|
+
js.if("ctx.failFast && ctx.hasError()", () => js.return())
|
|
244
|
+
if (this.basis) {
|
|
245
|
+
js.check(this.basis)
|
|
246
|
+
// we only have to return conditionally if this is not the last check
|
|
247
|
+
if (this.traversables.length > 1) returnIfFail()
|
|
248
|
+
}
|
|
249
|
+
if (this.refinements.length) {
|
|
250
|
+
for (let i = 0; i < this.refinements.length - 1; i++) {
|
|
251
|
+
js.check(this.refinements[i])
|
|
252
|
+
returnIfFailFast()
|
|
253
|
+
}
|
|
254
|
+
js.check(this.refinements.at(-1))
|
|
255
|
+
if (this.props || this.predicate) returnIfFail()
|
|
256
|
+
}
|
|
257
|
+
if (this.props) {
|
|
258
|
+
this.props.compile(js)
|
|
259
|
+
if (this.predicate) returnIfFail()
|
|
260
|
+
}
|
|
261
|
+
if (this.predicate) {
|
|
262
|
+
for (let i = 0; i < this.predicate.length - 1; i++) {
|
|
263
|
+
js.check(this.predicate[i])
|
|
264
|
+
// since predicates can be chained, we have to fail immediately
|
|
265
|
+
// if one fails
|
|
266
|
+
returnIfFail()
|
|
267
|
+
}
|
|
268
|
+
js.check(this.predicate.at(-1))
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
rawKeyOf() {
|
|
272
|
+
return this.basis
|
|
273
|
+
? this.props
|
|
274
|
+
? this.basis.rawKeyOf().or(this.props.rawKeyOf())
|
|
275
|
+
: this.basis.rawKeyOf()
|
|
276
|
+
: this.props?.rawKeyOf() ?? this.$.keywords.never
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
const maybeCreatePropsGroup = (inner, $) => {
|
|
280
|
+
const propsInput = pick(inner, propKeys)
|
|
281
|
+
return isEmptyObject(propsInput) ? undefined : new PropsGroup(propsInput, $)
|
|
282
|
+
}
|
|
283
|
+
const intersectRootKeys = (l, r) => {
|
|
284
|
+
const result = {}
|
|
285
|
+
const lBasis = l.proto ?? l.domain
|
|
286
|
+
const rBasis = r.proto ?? r.domain
|
|
287
|
+
const resultBasis = lBasis
|
|
288
|
+
? rBasis
|
|
289
|
+
? lBasis.intersect(rBasis)
|
|
290
|
+
: lBasis
|
|
291
|
+
: rBasis
|
|
292
|
+
if (resultBasis) {
|
|
293
|
+
if (resultBasis instanceof Disjoint) {
|
|
294
|
+
return resultBasis
|
|
295
|
+
}
|
|
296
|
+
if (resultBasis.kind === "domain" || resultBasis.kind === "proto") {
|
|
297
|
+
result[resultBasis.kind] = resultBasis
|
|
298
|
+
} else {
|
|
299
|
+
return throwInternalError(
|
|
300
|
+
`Unexpected intersection basis intersection ${resultBasis}`
|
|
301
|
+
)
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
if (l.onExtraneousKey || r.onExtraneousKey) {
|
|
305
|
+
result.onExtraneousKey =
|
|
306
|
+
l.onExtraneousKey === "throw" || r.onExtraneousKey === "throw"
|
|
307
|
+
? "throw"
|
|
308
|
+
: "prune"
|
|
309
|
+
}
|
|
310
|
+
return result
|
|
311
|
+
}
|
|
312
|
+
const intersectConstraints = (s) => {
|
|
313
|
+
if (!s.r.length) {
|
|
314
|
+
let result = s.$.node(
|
|
315
|
+
"intersection",
|
|
316
|
+
Object.assign(s.root, unflattenConstraints(s.l)),
|
|
317
|
+
{ prereduced: true }
|
|
318
|
+
)
|
|
319
|
+
for (const type of s.types) {
|
|
320
|
+
if (result instanceof Disjoint) {
|
|
321
|
+
return result
|
|
322
|
+
}
|
|
323
|
+
result = type.intersect(result)
|
|
324
|
+
}
|
|
325
|
+
return result
|
|
326
|
+
}
|
|
327
|
+
const head = s.r.shift()
|
|
328
|
+
let matched = false
|
|
329
|
+
for (let i = 0; i < s.l.length; i++) {
|
|
330
|
+
const result = s.l[i].intersect(head)
|
|
331
|
+
if (result === null) continue
|
|
332
|
+
if (result instanceof Disjoint) return result
|
|
333
|
+
if (!matched) {
|
|
334
|
+
if (result.isType()) s.types.push(result)
|
|
335
|
+
else s.l[i] = result
|
|
336
|
+
matched = true
|
|
337
|
+
} else if (!s.l.includes(result)) {
|
|
338
|
+
return throwInternalError(
|
|
339
|
+
`Unexpectedly encountered multiple distinct intersection results for refinement ${result}`
|
|
340
|
+
)
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
if (!matched) {
|
|
344
|
+
s.l.push(head)
|
|
345
|
+
}
|
|
346
|
+
head.impliedSiblings?.forEach((node) => appendUnique(s.r, node))
|
|
347
|
+
return intersectConstraints(s)
|
|
348
|
+
}
|
|
349
|
+
const flattenConstraints = (inner) => {
|
|
350
|
+
const result = entriesOf(inner)
|
|
351
|
+
.flatMap(([k, v]) => (k in constraintKeys ? v : []))
|
|
352
|
+
.sort((l, r) =>
|
|
353
|
+
l.precedence < r.precedence
|
|
354
|
+
? -1
|
|
355
|
+
: l.precedence > r.precedence
|
|
356
|
+
? 1
|
|
357
|
+
: l.innerId < r.innerId
|
|
358
|
+
? -1
|
|
359
|
+
: 1
|
|
360
|
+
)
|
|
361
|
+
return result
|
|
362
|
+
}
|
|
363
|
+
const unflattenConstraints = (constraints) => {
|
|
364
|
+
const inner = {}
|
|
365
|
+
for (const constraint of constraints) {
|
|
366
|
+
if (constraint.intersectionIsOpen) {
|
|
367
|
+
inner[constraint.kind] = append(inner[constraint.kind], constraint)
|
|
368
|
+
} else {
|
|
369
|
+
if (inner[constraint.kind]) {
|
|
370
|
+
return throwInternalError(
|
|
371
|
+
`Unexpected intersection of closed refinements of kind ${constraint.kind}`
|
|
372
|
+
)
|
|
373
|
+
}
|
|
374
|
+
inner[constraint.kind] = constraint
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
return inner
|
|
378
|
+
}
|
|
379
|
+
//# sourceMappingURL=intersection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"intersection.js","sourceRoot":"","sources":["../../types/intersection.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,MAAM,EACN,YAAY,EACZ,eAAe,EACf,SAAS,EACT,OAAO,EACP,aAAa,EACb,IAAI,EACJ,IAAI,EACJ,WAAW,EACX,kBAAkB,EAIlB,MAAM,eAAe,CAAA;AACtB,OAAO,EAAE,QAAQ,EAAkC,MAAM,YAAY,CAAA;AACrE,OAAO,EACN,UAAU,EAGV,MAAM,+BAA+B,CAAA;AAKtC,OAAO,EAAE,QAAQ,EAAmC,MAAM,sBAAsB,CAAA;AAChF,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAEhD,OAAO,EACN,cAAc,EACd,QAAQ,EAOR,MAAM,wBAAwB,CAAA;AAI/B,OAAO,EAAE,QAAQ,EAAE,4BAA4B,EAAa,MAAM,WAAW,CAAA;AAgC7E,MAAM,0BAA0B,GAC/B,CAAqC,IAAU,EAAE,EAAE,CACnD,CACC,KAA6B,EAC7B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,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,EACtB,UAAU,CACD,CAAA;QACX,CAAC;aAAM,CAAC;YACP,IAAI,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;gBAC5B,OAAO,kBAAkB,CACxB,yDAAyD,UAAU,CAAC,IAAI,EAAE,CAC1E,CAAA;YACF,CAAC;YACD,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,UAAmB,CAAA;QAC7C,CAAC;IACF,CAAC;IACD,OAAO,KAAK,CAAA;AACb,CAAC,CAAA"}
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import {
|
|
2
|
+
type BuiltinObjectKind,
|
|
3
|
+
type BuiltinObjects,
|
|
4
|
+
type Primitive,
|
|
5
|
+
type array,
|
|
6
|
+
type listable
|
|
7
|
+
} from "@arktype/util"
|
|
8
|
+
import type { Node } from "../base.js"
|
|
9
|
+
import type { of } from "../constraints/ast.js"
|
|
10
|
+
import type { Schema } from "../kinds.js"
|
|
11
|
+
import type { StaticArkOption } from "../scope.js"
|
|
12
|
+
import type { NodeCompiler } from "../shared/compile.js"
|
|
13
|
+
import type { BaseMeta, declareNode } from "../shared/declare.js"
|
|
14
|
+
import type { ArkResult, ArkTypeError } from "../shared/errors.js"
|
|
15
|
+
import { type nodeImplementationOf } from "../shared/implement.js"
|
|
16
|
+
import type {
|
|
17
|
+
TraversalContext,
|
|
18
|
+
TraverseAllows,
|
|
19
|
+
TraverseApply
|
|
20
|
+
} from "../shared/traversal.js"
|
|
21
|
+
import { BaseType, type Type, type typeKindRightOf } from "./type.js"
|
|
22
|
+
export type MorphChildKind = typeKindRightOf<"morph">
|
|
23
|
+
export declare const morphChildKinds: readonly [
|
|
24
|
+
"intersection",
|
|
25
|
+
"unit",
|
|
26
|
+
"proto",
|
|
27
|
+
"domain"
|
|
28
|
+
]
|
|
29
|
+
export type MorphChildNode = Node<MorphChildKind>
|
|
30
|
+
export type MorphChildDefinition = Schema<MorphChildKind>
|
|
31
|
+
export type Morph<i = any, o = unknown> = (In: i, ctx: TraversalContext) => o
|
|
32
|
+
export type Out<o = any> = ["=>", o]
|
|
33
|
+
export type MorphAst<i = any, o = any> = (In: i) => Out<o>
|
|
34
|
+
export interface MorphInner extends BaseMeta {
|
|
35
|
+
readonly in: MorphChildNode
|
|
36
|
+
readonly out: MorphChildNode
|
|
37
|
+
readonly morphs: readonly Morph[]
|
|
38
|
+
}
|
|
39
|
+
export interface MorphSchema extends BaseMeta {
|
|
40
|
+
readonly in: MorphChildDefinition
|
|
41
|
+
readonly out?: MorphChildDefinition
|
|
42
|
+
readonly morphs: listable<Morph>
|
|
43
|
+
}
|
|
44
|
+
export type MorphDeclaration = declareNode<{
|
|
45
|
+
kind: "morph"
|
|
46
|
+
schema: MorphSchema
|
|
47
|
+
normalizedSchema: MorphSchema
|
|
48
|
+
inner: MorphInner
|
|
49
|
+
childKind: MorphChildKind
|
|
50
|
+
}>
|
|
51
|
+
export declare class MorphNode<t = any, $ = any> extends BaseType<
|
|
52
|
+
t,
|
|
53
|
+
MorphDeclaration,
|
|
54
|
+
$
|
|
55
|
+
> {
|
|
56
|
+
static implementation: nodeImplementationOf<MorphDeclaration>
|
|
57
|
+
readonly expression: string
|
|
58
|
+
readonly serializedMorphs: `$ark.${string}`[]
|
|
59
|
+
traverseAllows: TraverseAllows
|
|
60
|
+
traverseApply: TraverseApply
|
|
61
|
+
compile(js: NodeCompiler): void
|
|
62
|
+
get in(): Node<MorphChildKind, distillConstrainableIn<t>>
|
|
63
|
+
get out(): Node<MorphChildKind, distillConstrainableOut<t>>
|
|
64
|
+
rawKeyOf(): Type
|
|
65
|
+
}
|
|
66
|
+
export type inferMorphOut<out> = out extends ArkResult<unknown, infer innerOut>
|
|
67
|
+
? out extends null
|
|
68
|
+
? out
|
|
69
|
+
: innerOut
|
|
70
|
+
: Exclude<out, ArkTypeError>
|
|
71
|
+
export type distillIn<t> = includesMorphs<t> extends true
|
|
72
|
+
? distillRecurse<t, "in", "base">
|
|
73
|
+
: t
|
|
74
|
+
export type distillOut<t> = includesMorphs<t> extends true
|
|
75
|
+
? distillRecurse<t, "out", "base">
|
|
76
|
+
: t
|
|
77
|
+
export type distillConstrainableIn<t> = includesMorphs<t> extends true
|
|
78
|
+
? distillRecurse<t, "in", "constrainable">
|
|
79
|
+
: t
|
|
80
|
+
export type distillConstrainableOut<t> = includesMorphs<t> extends true
|
|
81
|
+
? distillRecurse<t, "out", "constrainable">
|
|
82
|
+
: t
|
|
83
|
+
export type includesMorphs<t> = [
|
|
84
|
+
t,
|
|
85
|
+
distillRecurse<t, "in", "base">,
|
|
86
|
+
t,
|
|
87
|
+
distillRecurse<t, "out", "base">
|
|
88
|
+
] extends [
|
|
89
|
+
distillRecurse<t, "in", "base">,
|
|
90
|
+
t,
|
|
91
|
+
distillRecurse<t, "out", "base">,
|
|
92
|
+
t
|
|
93
|
+
]
|
|
94
|
+
? false
|
|
95
|
+
: true
|
|
96
|
+
type distillRecurse<
|
|
97
|
+
t,
|
|
98
|
+
io extends "in" | "out",
|
|
99
|
+
distilledKind extends "base" | "constrainable"
|
|
100
|
+
> = unknown extends t
|
|
101
|
+
? unknown
|
|
102
|
+
: t extends MorphAst<infer i, infer o>
|
|
103
|
+
? io extends "in"
|
|
104
|
+
? i
|
|
105
|
+
: o
|
|
106
|
+
: t extends of<infer base, any>
|
|
107
|
+
? distilledKind extends "base"
|
|
108
|
+
? distillRecurse<base, io, distilledKind>
|
|
109
|
+
: t
|
|
110
|
+
: t extends TerminallyInferredObjectKind | Primitive
|
|
111
|
+
? t
|
|
112
|
+
: t extends array
|
|
113
|
+
? distillArray<t, io, distilledKind, []>
|
|
114
|
+
: {
|
|
115
|
+
[k in keyof t]: distillRecurse<
|
|
116
|
+
t[k],
|
|
117
|
+
io,
|
|
118
|
+
distilledKind
|
|
119
|
+
>
|
|
120
|
+
}
|
|
121
|
+
type distillArray<
|
|
122
|
+
t extends array,
|
|
123
|
+
io extends "in" | "out",
|
|
124
|
+
constraints extends "base" | "constrainable",
|
|
125
|
+
prefix extends array
|
|
126
|
+
> = t extends readonly [infer head, ...infer tail]
|
|
127
|
+
? distillArray<
|
|
128
|
+
tail,
|
|
129
|
+
io,
|
|
130
|
+
constraints,
|
|
131
|
+
[...prefix, distillRecurse<head, io, constraints>]
|
|
132
|
+
>
|
|
133
|
+
: [...prefix, ...distillPostfix<t, io, constraints>]
|
|
134
|
+
type distillPostfix<
|
|
135
|
+
t extends array,
|
|
136
|
+
io extends "in" | "out",
|
|
137
|
+
constraints extends "base" | "constrainable",
|
|
138
|
+
postfix extends array = []
|
|
139
|
+
> = t extends readonly [...infer init, infer last]
|
|
140
|
+
? distillPostfix<
|
|
141
|
+
init,
|
|
142
|
+
io,
|
|
143
|
+
constraints,
|
|
144
|
+
[distillRecurse<last, io, constraints>, ...postfix]
|
|
145
|
+
>
|
|
146
|
+
: [
|
|
147
|
+
...{
|
|
148
|
+
[i in keyof t]: distillRecurse<t[i], io, constraints>
|
|
149
|
+
},
|
|
150
|
+
...postfix
|
|
151
|
+
]
|
|
152
|
+
/** Objects we don't want to expand during inference like Date or Promise */
|
|
153
|
+
type TerminallyInferredObjectKind =
|
|
154
|
+
| StaticArkOption<"preserve">
|
|
155
|
+
| BuiltinObjects[Exclude<BuiltinObjectKind, "Array">]
|
|
156
|
+
export {}
|
|
157
|
+
//# sourceMappingURL=morph.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"morph.d.ts","sourceRoot":"","sources":["../../types/morph.ts"],"names":[],"mappings":"AAAA,OAAO,EAIN,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACnB,KAAK,SAAS,EACd,KAAK,KAAK,EACV,KAAK,QAAQ,EACb,MAAM,eAAe,CAAA;AACtB,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AACtC,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,uBAAuB,CAAA;AAC/C,OAAO,KAAK,EAAE,MAAM,EA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G,CAAC,IAAI,MAAM,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,WAAW,CAAC;CAAE,EAAE,GAAG,OAAO,CAAC,CAAA;AAE7E,4EAA4E;AAC5E,KAAK,4BAA4B,GAC9B,eAAe,CAAC,UAAU,CAAC,GAC3B,cAAc,CAAC,OAAO,CAAC,iBAAiB,EAAE,OAAO,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { listFrom, reference, throwParseError } from "@arktype/util"
|
|
2
|
+
import { Disjoint } from "../shared/disjoint.js"
|
|
3
|
+
import { basisKinds } from "../shared/implement.js"
|
|
4
|
+
import { BaseType, defineRightwardIntersections } from "./type.js"
|
|
5
|
+
export const morphChildKinds = ["intersection", ...basisKinds]
|
|
6
|
+
export class MorphNode extends BaseType {
|
|
7
|
+
// TODO: recursively extract in?
|
|
8
|
+
static implementation = this.implement({
|
|
9
|
+
hasAssociatedError: false,
|
|
10
|
+
keys: {
|
|
11
|
+
in: {
|
|
12
|
+
child: true,
|
|
13
|
+
parse: (schema, ctx) =>
|
|
14
|
+
ctx.$.node(schema, { allowedKinds: morphChildKinds })
|
|
15
|
+
},
|
|
16
|
+
out: {
|
|
17
|
+
child: true,
|
|
18
|
+
parse: (schema, ctx) =>
|
|
19
|
+
ctx.$.node(schema, { allowedKinds: morphChildKinds })
|
|
20
|
+
},
|
|
21
|
+
morphs: {
|
|
22
|
+
parse: listFrom,
|
|
23
|
+
serialize: (morphs) => morphs.map(reference)
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
normalize: (schema) => schema,
|
|
27
|
+
defaults: {
|
|
28
|
+
description(node) {
|
|
29
|
+
return `a morph from ${node.in.description} to ${node.out.description}`
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
intersections: {
|
|
33
|
+
morph: (l, r, $) => {
|
|
34
|
+
if (l.morphs.some((morph, i) => morph !== r.morphs[i])) {
|
|
35
|
+
// TODO: is this always a parse error? what about for union reduction etc.
|
|
36
|
+
// TODO: check in for union reduction
|
|
37
|
+
return throwParseError(`Invalid intersection of morphs`)
|
|
38
|
+
}
|
|
39
|
+
const inTersection = l.in.intersect(r.in)
|
|
40
|
+
if (inTersection instanceof Disjoint) {
|
|
41
|
+
return inTersection
|
|
42
|
+
}
|
|
43
|
+
const outTersection = l.out.intersect(r.out)
|
|
44
|
+
if (outTersection instanceof Disjoint) {
|
|
45
|
+
return outTersection
|
|
46
|
+
}
|
|
47
|
+
return $.node("morph", {
|
|
48
|
+
morphs: l.morphs,
|
|
49
|
+
in: inTersection,
|
|
50
|
+
out: outTersection
|
|
51
|
+
})
|
|
52
|
+
},
|
|
53
|
+
...defineRightwardIntersections("morph", (l, r, $) => {
|
|
54
|
+
const inTersection = l.in.intersect(r)
|
|
55
|
+
return inTersection instanceof Disjoint
|
|
56
|
+
? inTersection
|
|
57
|
+
: inTersection.kind === "union"
|
|
58
|
+
? $.node(
|
|
59
|
+
"union",
|
|
60
|
+
inTersection.branches.map((branch) => ({
|
|
61
|
+
...l.inner,
|
|
62
|
+
in: branch
|
|
63
|
+
}))
|
|
64
|
+
)
|
|
65
|
+
: $.node("morph", {
|
|
66
|
+
...l.inner,
|
|
67
|
+
in: inTersection
|
|
68
|
+
})
|
|
69
|
+
})
|
|
70
|
+
}
|
|
71
|
+
})
|
|
72
|
+
expression = `(In: ${this.in.expression}) => Out<${this.out.expression}>`
|
|
73
|
+
serializedMorphs = this.morphs.map((morph) => reference(morph))
|
|
74
|
+
traverseAllows = (data, ctx) => this.in.traverseAllows(data, ctx)
|
|
75
|
+
traverseApply = (data, ctx) => {
|
|
76
|
+
this.morphs.forEach((morph) => ctx.queueMorph(morph))
|
|
77
|
+
this.in.traverseApply(data, ctx)
|
|
78
|
+
}
|
|
79
|
+
compile(js) {
|
|
80
|
+
if (js.traversalKind === "Allows") {
|
|
81
|
+
js.return(js.invoke(this.in))
|
|
82
|
+
return
|
|
83
|
+
}
|
|
84
|
+
this.serializedMorphs.forEach((name) =>
|
|
85
|
+
js.line(`ctx.queueMorph(${name})`)
|
|
86
|
+
)
|
|
87
|
+
js.line(js.invoke(this.in))
|
|
88
|
+
}
|
|
89
|
+
get in() {
|
|
90
|
+
return this.inner.in
|
|
91
|
+
}
|
|
92
|
+
get out() {
|
|
93
|
+
return this.inner.out ?? this.$.keywords.unknown
|
|
94
|
+
}
|
|
95
|
+
rawKeyOf() {
|
|
96
|
+
return this.in.rawKeyOf()
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
//# sourceMappingURL=morph.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"morph.js","sourceRoot":"","sources":["../../types/morph.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,QAAQ,EACR,SAAS,EACT,eAAe,EAMf,MAAM,eAAe,CAAA;AAOtB,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAEhD,OAAO,EAAE,UAAU,EAA6B,MAAM,wBAAwB,CAAA;AAM9E,OAAO,EACN,QAAQ,EACR,4BAA4B,EAG5B,MAAM,WAAW,CAAA;AAIlB,MAAM,CAAC,MAAM,eAAe,GAAG;IAC9B,cAAc;IACd,GAAG,UAAU;CACgC,CAAA;AAgC9C,MAAM,OAAO,SAA4B,SAAQ,QAIhD;IACA,gCAAgC;IAChC,MAAM,CAAC,cAAc,GACpB,IAAI,CAAC,SAAS,CAAC;QACd,kBAAkB,EAAE,KAAK;QACzB,IAAI,EAAE;YACL,EAAE,EAAE;gBACH,KAAK,EAAE,IAAI;gBACX,KAAK,EAAE,CAAC,MAAM,EAAE,GAAG,EAAE,EAAE,CACtB,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,YAAY,EAAE,eAAe,EAAE,CAAC;aACtD;YACD,GAAG,EAAE;gBACJ,KAAK,EAAE,IAAI;gBACX,KAAK,EAAE,CAAC,MAAM,EAAE,GAAG,EAAE,EAAE,CACtB,G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