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,119 @@
|
|
|
1
|
+
import { type array, type valueOf } from "@arktype/util"
|
|
2
|
+
import type { Node } from "../../base.js"
|
|
3
|
+
import type { BaseMeta, BaseNodeDeclaration } from "../../shared/declare.js"
|
|
4
|
+
import type { KeyDefinitions, RangeKind } from "../../shared/implement.js"
|
|
5
|
+
import { BasePrimitiveConstraint } from "../constraint.js"
|
|
6
|
+
export declare abstract class BaseRange<
|
|
7
|
+
d extends BaseRangeDeclaration
|
|
8
|
+
> extends BasePrimitiveConstraint<d> {
|
|
9
|
+
readonly boundOperandKind: {
|
|
10
|
+
readonly min: "value"
|
|
11
|
+
readonly max: "value"
|
|
12
|
+
readonly minLength: "length"
|
|
13
|
+
readonly maxLength: "length"
|
|
14
|
+
readonly after: "date"
|
|
15
|
+
readonly before: "date"
|
|
16
|
+
}[d["kind"]]
|
|
17
|
+
readonly compiledActual: string
|
|
18
|
+
readonly comparator: ">" | "<" | ">=" | "<="
|
|
19
|
+
readonly numericLimit: number
|
|
20
|
+
readonly expression: string
|
|
21
|
+
readonly compiledCondition: string
|
|
22
|
+
readonly compiledNegation: string
|
|
23
|
+
readonly stringLimit: string
|
|
24
|
+
readonly errorContext: import("../../shared/declare.js").BaseErrorContext<
|
|
25
|
+
d["kind"]
|
|
26
|
+
> &
|
|
27
|
+
d["inner"] extends infer T
|
|
28
|
+
? {
|
|
29
|
+
[k in keyof T]: (import("../../shared/declare.js").BaseErrorContext<
|
|
30
|
+
d["kind"]
|
|
31
|
+
> &
|
|
32
|
+
d["inner"])[k]
|
|
33
|
+
}
|
|
34
|
+
: never
|
|
35
|
+
readonly limitKind: LimitKind
|
|
36
|
+
isStricterThan(r: Node<d["kind"] | pairedRangeKind<d["kind"]>>): boolean
|
|
37
|
+
overlapsRange(r: Node<pairedRangeKind<d["kind"]>>): boolean
|
|
38
|
+
overlapIsUnit(r: Node<pairedRangeKind<d["kind"]>>): boolean
|
|
39
|
+
}
|
|
40
|
+
export interface BaseRangeInner extends BaseMeta {
|
|
41
|
+
readonly rule: number | Date
|
|
42
|
+
readonly exclusive?: true
|
|
43
|
+
}
|
|
44
|
+
export type LimitSchemaValue<kind extends RangeKind = RangeKind> = kind extends
|
|
45
|
+
| "before"
|
|
46
|
+
| "after"
|
|
47
|
+
? Date | number | string
|
|
48
|
+
: number
|
|
49
|
+
export type LimitInnerValue<kind extends RangeKind = RangeKind> = kind extends
|
|
50
|
+
| "before"
|
|
51
|
+
| "after"
|
|
52
|
+
? Date
|
|
53
|
+
: number
|
|
54
|
+
export interface BaseNormalizedRangeSchema extends BaseMeta {
|
|
55
|
+
readonly exclusive?: boolean
|
|
56
|
+
}
|
|
57
|
+
export type LimitKind = "lower" | "upper"
|
|
58
|
+
export type RelativeComparator<kind extends LimitKind = LimitKind> = {
|
|
59
|
+
lower: ">" | ">="
|
|
60
|
+
upper: "<" | "<="
|
|
61
|
+
}[kind]
|
|
62
|
+
export declare const negatedComparators: {
|
|
63
|
+
readonly "<": ">="
|
|
64
|
+
readonly "<=": ">"
|
|
65
|
+
readonly ">": "<="
|
|
66
|
+
readonly ">=": "<"
|
|
67
|
+
}
|
|
68
|
+
export declare const boundKindPairsByLower: {
|
|
69
|
+
readonly min: "max"
|
|
70
|
+
readonly minLength: "maxLength"
|
|
71
|
+
readonly after: "before"
|
|
72
|
+
}
|
|
73
|
+
type BoundKindPairsByLower = typeof boundKindPairsByLower
|
|
74
|
+
export declare const boundKindPairsByUpper: {
|
|
75
|
+
max: "min"
|
|
76
|
+
maxLength: "minLength"
|
|
77
|
+
before: "after"
|
|
78
|
+
}
|
|
79
|
+
type BoundKindPairsByUpper = typeof boundKindPairsByUpper
|
|
80
|
+
export type pairedRangeKind<kind extends RangeKind> =
|
|
81
|
+
kind extends LowerBoundKind
|
|
82
|
+
? BoundKindPairsByLower[kind]
|
|
83
|
+
: BoundKindPairsByUpper[kind & UpperBoundKind]
|
|
84
|
+
export type LowerBoundKind = keyof typeof boundKindPairsByLower
|
|
85
|
+
export type LowerNode = Node<LowerBoundKind>
|
|
86
|
+
export type UpperBoundKind = valueOf<typeof boundKindPairsByLower>
|
|
87
|
+
export type UpperNode = Node<UpperBoundKind>
|
|
88
|
+
export type NumericallyBoundable = string | number | array
|
|
89
|
+
export type Boundable = NumericallyBoundable | Date
|
|
90
|
+
export declare const parseExclusiveKey: KeyDefinitions<BaseRangeDeclaration>["exclusive"]
|
|
91
|
+
export declare const parseDateLimit: (limit: LimitSchemaValue) => Date
|
|
92
|
+
export interface BaseRangeDeclaration extends BaseNodeDeclaration {
|
|
93
|
+
kind: RangeKind
|
|
94
|
+
inner: BaseRangeInner
|
|
95
|
+
normalizedSchema: BaseNormalizedRangeSchema
|
|
96
|
+
}
|
|
97
|
+
export declare const operandKindsByBoundKind: {
|
|
98
|
+
readonly min: "value"
|
|
99
|
+
readonly max: "value"
|
|
100
|
+
readonly minLength: "length"
|
|
101
|
+
readonly maxLength: "length"
|
|
102
|
+
readonly after: "date"
|
|
103
|
+
readonly before: "date"
|
|
104
|
+
}
|
|
105
|
+
export declare const compileComparator: (
|
|
106
|
+
kind: RangeKind,
|
|
107
|
+
exclusive: boolean | undefined
|
|
108
|
+
) => ">" | "<" | ">=" | "<="
|
|
109
|
+
export type BoundOperandKind = "value" | "length" | "date"
|
|
110
|
+
export type LengthBoundableData = string | array
|
|
111
|
+
export type DateRangeKind = "before" | "after"
|
|
112
|
+
export declare const dateLimitToString: (limit: LimitSchemaValue) => string
|
|
113
|
+
export declare const writeUnboundableMessage: <root extends string>(
|
|
114
|
+
root: root
|
|
115
|
+
) => `Bounded expression ${root} must be a number, string, Array, or Date`
|
|
116
|
+
export type writeUnboundableMessage<root extends string> =
|
|
117
|
+
`Bounded expression ${root} must be a number, string, Array, or Date`
|
|
118
|
+
export {}
|
|
119
|
+
//# sourceMappingURL=range.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"range.d.ts","sourceRoot":"","sources":["../../../constraints/refinements/range.ts"],"names":[],"mappings":"AAAA,OAAO,EAGN,KAAK,KAAK,EAEV,KAAK,OAAO,EACZ,MAAM,eAAe,CAAA;AACtB,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;AACzC,OAAO,KAAK,EAAE,QAAQ,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAA;AAC5E,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;AAC1E,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAA;AAE1D,8BAAsB,SAAS,CAC9B,CAAC,SAAS,oBAAoB,CAC7B,SAAQ,uBAAuB,CAAC,CAAC,CAAC;IACnC,QAAQ,CAAC,gBAAgB;;;;;;;iBAAqC;IAC9D,QAAQ,CAAC,cAAc,SAKH;IACpB,QAAQ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AAA;AAExD,eAAO,MAAM,iBAAiB,SACvB,SAAS,aACJ,OAAO,GAAG,SAAS,4BAInB,CAAA;AAEZ,MAAM,MAAM,gBAAgB,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAA;AAE1D,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,KAAK,CAAA;AAEhD,MAAM,MAAM,aAAa,GAAG,QAAQ,GAAG,OAAO,CAAA;AAE9C,eAAO,MAAM,iBAAiB,UAAW,gBAAgB,KAAG,MACS,CAAA;AAErE,eAAO,MAAM,uBAAuB,4GAGkC,CAAA;AAEtE,MAAM,MAAM,uBAAuB,CAAC,IAAI,SAAS,MAAM,IACtD,sBAAsB,IAAI,2CAA2C,CAAA"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { invert, isKeyOf } from "@arktype/util"
|
|
2
|
+
import { BasePrimitiveConstraint } from "../constraint.js"
|
|
3
|
+
export class BaseRange extends BasePrimitiveConstraint {
|
|
4
|
+
boundOperandKind = operandKindsByBoundKind[this.kind]
|
|
5
|
+
compiledActual =
|
|
6
|
+
this.boundOperandKind === "value"
|
|
7
|
+
? `data`
|
|
8
|
+
: this.boundOperandKind === "length"
|
|
9
|
+
? `data.length`
|
|
10
|
+
: `data.valueOf()`
|
|
11
|
+
comparator = compileComparator(this.kind, this.exclusive)
|
|
12
|
+
numericLimit = this.rule.valueOf()
|
|
13
|
+
expression = `${this.comparator}${this.rule}`
|
|
14
|
+
compiledCondition = `${this.compiledActual} ${this.comparator} ${this.numericLimit}`
|
|
15
|
+
compiledNegation = `${this.compiledActual} ${
|
|
16
|
+
negatedComparators[this.comparator]
|
|
17
|
+
} ${this.numericLimit}`
|
|
18
|
+
// we need to compute stringLimit before errorContext, which references it
|
|
19
|
+
// transitively through description for date bounds
|
|
20
|
+
stringLimit =
|
|
21
|
+
this.boundOperandKind === "date"
|
|
22
|
+
? dateLimitToString(this.numericLimit)
|
|
23
|
+
: `${this.numericLimit}`
|
|
24
|
+
errorContext = this.createErrorContext(this.inner)
|
|
25
|
+
limitKind = this.comparator["0"] === "<" ? "upper" : "lower"
|
|
26
|
+
isStricterThan(r) {
|
|
27
|
+
const thisLimitIsStricter =
|
|
28
|
+
this.limitKind === "upper"
|
|
29
|
+
? this.numericLimit < r.numericLimit
|
|
30
|
+
: this.numericLimit > r.numericLimit
|
|
31
|
+
return (
|
|
32
|
+
thisLimitIsStricter ||
|
|
33
|
+
(this.numericLimit === r.numericLimit &&
|
|
34
|
+
this.exclusive === true &&
|
|
35
|
+
!r.exclusive)
|
|
36
|
+
)
|
|
37
|
+
}
|
|
38
|
+
overlapsRange(r) {
|
|
39
|
+
if (this.isStricterThan(r)) return false
|
|
40
|
+
if (
|
|
41
|
+
this.numericLimit === r.numericLimit &&
|
|
42
|
+
(this.exclusive || r.exclusive)
|
|
43
|
+
)
|
|
44
|
+
return false
|
|
45
|
+
return true
|
|
46
|
+
}
|
|
47
|
+
overlapIsUnit(r) {
|
|
48
|
+
return (
|
|
49
|
+
this.numericLimit === r.numericLimit &&
|
|
50
|
+
!this.exclusive &&
|
|
51
|
+
!r.exclusive
|
|
52
|
+
)
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
export const negatedComparators = {
|
|
56
|
+
"<": ">=",
|
|
57
|
+
"<=": ">",
|
|
58
|
+
">": "<=",
|
|
59
|
+
">=": "<"
|
|
60
|
+
}
|
|
61
|
+
export const boundKindPairsByLower = {
|
|
62
|
+
min: "max",
|
|
63
|
+
minLength: "maxLength",
|
|
64
|
+
after: "before"
|
|
65
|
+
}
|
|
66
|
+
export const boundKindPairsByUpper = invert(boundKindPairsByLower)
|
|
67
|
+
export const parseExclusiveKey = {
|
|
68
|
+
// omit key with value false since it is the default
|
|
69
|
+
parse: (flag) => flag || undefined
|
|
70
|
+
}
|
|
71
|
+
export const parseDateLimit = (limit) =>
|
|
72
|
+
typeof limit === "string" || typeof limit === "number"
|
|
73
|
+
? new Date(limit)
|
|
74
|
+
: limit
|
|
75
|
+
export const operandKindsByBoundKind = {
|
|
76
|
+
min: "value",
|
|
77
|
+
max: "value",
|
|
78
|
+
minLength: "length",
|
|
79
|
+
maxLength: "length",
|
|
80
|
+
after: "date",
|
|
81
|
+
before: "date"
|
|
82
|
+
}
|
|
83
|
+
export const compileComparator = (kind, exclusive) =>
|
|
84
|
+
`${isKeyOf(kind, boundKindPairsByLower) ? ">" : "<"}${exclusive ? "" : "="}`
|
|
85
|
+
export const dateLimitToString = (limit) =>
|
|
86
|
+
typeof limit === "string" ? limit : new Date(limit).toLocaleString()
|
|
87
|
+
export const writeUnboundableMessage = (root) =>
|
|
88
|
+
`Bounded expression ${root} must be a number, string, Array, or Date`
|
|
89
|
+
//# sourceMappingURL=range.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"range.js","sourceRoot":"","sources":["../../../constraints/refinements/range.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,MAAM,EACN,OAAO,EAIP,MAAM,eAAe,CAAA;AAItB,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAA;AAE1D,MAAM,OAAgB,SAEpB,SAAQ,uBAA0B;IAC1B,gBAAgB,GAAG,uBAAuB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IACrD,cAAc,GACtB,IAAI,CAAC,gBAAgB,KAAK,OAAO;QAChC,CAAC,CAAC,MAAM;QACR,CAAC,CAAC,IAAI,CAAC,gBAAgB,KAAK,QAAQ;YACpC,CAAC,CAAC,aAAa;YACf,CAAC,CAAC,gBAAgB,CAAA;IACX,UAAU,GAAG,iBAAiB,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,CAAA;IACzD,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAA;IAClC,UAAU,GAAG,GAAG,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,IAAI,EAAE,CAAA;IAC7C,iBAAiB,GAAG,GAAG,IAAI,CAAC,cAAc,IAAI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,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAClB,EAAW,CAAA;AAQZ,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,KAAuB,EAAU,EAAE,CACpE,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC,cAAc,EAAE,CAAA;AAErE,MAAM,CAAC,MAAM,uBAAuB,GAAG,CACtC,IAAU,EACsB,EAAE,CAClC,sBAAsB,IAAI,2CAA2C,CAAA"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { BaseMeta, declareNode } from "../../shared/declare.js"
|
|
2
|
+
import { BasePrimitiveConstraint } from "../constraint.js"
|
|
3
|
+
export interface RegexInner extends BaseMeta {
|
|
4
|
+
readonly rule: string
|
|
5
|
+
readonly flags?: string
|
|
6
|
+
}
|
|
7
|
+
export type NormalizedRegexSchema = RegexInner
|
|
8
|
+
export type RegexSchema = NormalizedRegexSchema | string | RegExp
|
|
9
|
+
export type RegexDeclaration = declareNode<{
|
|
10
|
+
kind: "regex"
|
|
11
|
+
schema: RegexSchema
|
|
12
|
+
normalizedSchema: NormalizedRegexSchema
|
|
13
|
+
inner: RegexInner
|
|
14
|
+
intersectionIsOpen: true
|
|
15
|
+
prerequisite: string
|
|
16
|
+
errorContext: RegexInner
|
|
17
|
+
}>
|
|
18
|
+
export declare class RegexNode extends BasePrimitiveConstraint<RegexDeclaration> {
|
|
19
|
+
static implementation: import("../../shared/implement.js").nodeImplementationOf<{
|
|
20
|
+
reducibleTo: "regex"
|
|
21
|
+
childKind: never
|
|
22
|
+
kind: "regex"
|
|
23
|
+
schema: RegexSchema
|
|
24
|
+
normalizedSchema: RegexInner
|
|
25
|
+
inner: RegexInner
|
|
26
|
+
intersectionIsOpen: true
|
|
27
|
+
prerequisite: string
|
|
28
|
+
errorContext: RegexInner &
|
|
29
|
+
import("../../shared/declare.js").BaseErrorContext<"regex">
|
|
30
|
+
}>
|
|
31
|
+
readonly instance: RegExp
|
|
32
|
+
readonly expression: string
|
|
33
|
+
traverseAllows: (string: string) => boolean
|
|
34
|
+
readonly compiledCondition: string
|
|
35
|
+
readonly compiledNegation: string
|
|
36
|
+
readonly impliedBasis: import("../../main.js").Type<
|
|
37
|
+
string,
|
|
38
|
+
import("../../keywords/tsPrimitive.js").tsPrimitive.exports
|
|
39
|
+
>
|
|
40
|
+
readonly errorContext: {
|
|
41
|
+
code: "regex"
|
|
42
|
+
readonly rule: string
|
|
43
|
+
readonly flags?: string
|
|
44
|
+
readonly description?: string
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=regex.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"regex.d.ts","sourceRoot":"","sources":["../../../constraints/refinements/regex.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AACpE,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAA;AAE1D,MAAM,WAAW,UAAW,SAAQ,QAAQ;IAC3C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CACvB;AAED,MAAM,MAAM,qBAAqB,GAAG,UAAU,CAAA;AAE9C,MAAM,MAAM,WAAW,GAAG,qBAAqB,GAAG,MAAM,GAAG,MAAM,CAAA;AAEjE,MAAM,MAAM,gBAAgB,GAAG,WAAW,CAAC;IAC1C,IAAI,EAAE,OAAO,CAAA;IACb,MAAM,EAAE,WAAW,CAAA;IACnB,gBAAgB,EAAE,qBAAqB,CAAA;IACvC,KAAK,EAAE,UAAU,CAAA;IACjB,kBAAkB,EAAE,IAAI,CAAA;IACxB,YAAY,EAAE,MAAM,CAAA;IACpB,YAAY,EAAE,UAAU,CAAA;CACxB,CAAC,CAAA;AAEF,qBAAa,SAAU,SAAQ,uBAAuB,CAAC,gBAAgB,CAAC;IACvE,MAAM,CAAC,cAAc;;;;;;;;;;OAyBnB;IAEF,QAAQ,CAAC,QAAQ,SAAoC;IACrD,QAAQ,CAAC,UAAU,SAAqB;IACxC,cAAc,8BAAyC;IAEvD,QAAQ,CAAC,iBAAiB,SAAkC;IAC5D,QAAQ,CAAC,gBAAgB,SAA+B;IACxD,QAAQ,CAAC,YAAY,oGAAyB;IAC9C,QAAQ,CAAC,YAAY;;;;;MAAsC;CAC3D"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { BasePrimitiveConstraint } from "../constraint.js"
|
|
2
|
+
export class RegexNode extends BasePrimitiveConstraint {
|
|
3
|
+
static implementation = this.implement({
|
|
4
|
+
collapsibleKey: "rule",
|
|
5
|
+
keys: {
|
|
6
|
+
rule: {},
|
|
7
|
+
flags: {}
|
|
8
|
+
},
|
|
9
|
+
normalize: (schema) =>
|
|
10
|
+
typeof schema === "string"
|
|
11
|
+
? { rule: schema }
|
|
12
|
+
: schema instanceof RegExp
|
|
13
|
+
? schema.flags
|
|
14
|
+
? { rule: schema.source, flags: schema.flags }
|
|
15
|
+
: { rule: schema.source }
|
|
16
|
+
: schema,
|
|
17
|
+
hasAssociatedError: true,
|
|
18
|
+
intersectionIsOpen: true,
|
|
19
|
+
intersections: {
|
|
20
|
+
// for now, non-equal regex are naively intersected
|
|
21
|
+
regex: () => null
|
|
22
|
+
},
|
|
23
|
+
defaults: {
|
|
24
|
+
description(node) {
|
|
25
|
+
return `matched by ${node.rule}`
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
})
|
|
29
|
+
instance = new RegExp(this.rule, this.flags)
|
|
30
|
+
expression = `${this.instance}`
|
|
31
|
+
traverseAllows = this.instance.test.bind(this.instance)
|
|
32
|
+
compiledCondition = `${this.expression}.test(data)`
|
|
33
|
+
compiledNegation = `!${this.compiledCondition}`
|
|
34
|
+
impliedBasis = this.$.keywords.string
|
|
35
|
+
errorContext = this.createErrorContext(this.inner)
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=regex.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"regex.js","sourceRoot":"","sources":["../../../constraints/refinements/regex.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAA;AAqB1D,MAAM,OAAO,SAAU,SAAQ,uBAAyC;IACvE,MAAM,CAAC,cAAc,GAAG,IAAI,CAAC,SAAS,CAAC;QACtC,cAAc,EAAE,MAAM;QACtB,IAAI,EAAE;YACL,IAAI,EAAE,EAAE;YACR,KAAK,EAAE,EAAE;SACT;QACD,SAAS,EAAE,CAAC,MAAM,EAAE,EAAE,CACrB,OAAO,MAAM,KAAK,QAAQ;YACzB,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE;YAClB,CAAC,CAAC,MAAM,YAAY,MAAM;gBAC1B,CAAC,CAAC,MAAM,CAAC,KAAK;oBACb,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE;oBAC9C,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE;gBAC1B,CAAC,CAAC,MAAM;QACV,kBAAkB,EAAE,IAAI;QACxB,kBAAkB,EAAE,IAAI;QACxB,aAAa,EAAE;YACd,mDAAmD;YACnD,KAAK,EAAE,GAAG,EAAE,CAAC,IAAI;SACjB;QACD,QAAQ,EAAE;YACT,WAAW,CAAC,IAAI;gBACf,OAAO,cAAc,IAAI,CAAC,IAAI,EAAE,CAAA;YACjC,CAAC;SACD;KACD,CAAC,CAAA;IAEO,QAAQ,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,CAAA;IAC5C,UAAU,GAAG,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAA;IACxC,cAAc,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;IAE9C,iBAAiB,GAAG,GAAG,IAAI,CAAC,UAAU,aAAa,CAAA;IACnD,gBAAgB,GAAG,IAAI,IAAI,CAAC,iBAAiB,EAAE,CAAA;IAC/C,YAAY,GAAG,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAA;IACrC,YAAY,GAAG,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export declare const rangeKinds: readonly [
|
|
2
|
+
"max",
|
|
3
|
+
"min",
|
|
4
|
+
"maxLength",
|
|
5
|
+
"minLength",
|
|
6
|
+
"before",
|
|
7
|
+
"after"
|
|
8
|
+
]
|
|
9
|
+
export type RangeKind = (typeof rangeKinds)[number]
|
|
10
|
+
export declare const boundKinds: readonly [
|
|
11
|
+
"length",
|
|
12
|
+
"max",
|
|
13
|
+
"min",
|
|
14
|
+
"maxLength",
|
|
15
|
+
"minLength",
|
|
16
|
+
"before",
|
|
17
|
+
"after"
|
|
18
|
+
]
|
|
19
|
+
export type BoundKind = (typeof boundKinds)[number]
|
|
20
|
+
//# sourceMappingURL=shared.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../constraints/refinements/shared.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,sEAOb,CAAA;AAEV,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,CAAC,CAAA;AAEnD,eAAO,MAAM,UAAU,gFAAqC,CAAA;AAE5D,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared.js","sourceRoot":"","sources":["../../../constraints/refinements/shared.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,UAAU,GAAG;IACzB,KAAK;IACL,KAAK;IACL,WAAW;IACX,WAAW;IACX,QAAQ;IACR,OAAO;CACE,CAAA;AAIV,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,QAAQ,EAAE,GAAG,UAAU,CAAU,CAAA"}
|
package/out/generic.d.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type GenericNodeInstantiation, type GenericProps, type SchemaScope, arkKind } from "@arktype/schema";
|
|
2
|
+
import { Callable, type conform } from "@arktype/util";
|
|
3
|
+
import type { inferDefinition } from "./parser/definition.js";
|
|
4
|
+
import type { GenericParamsParseError, parseGenericParams } from "./parser/generic.js";
|
|
5
|
+
import type { Type, inferTypeRoot, validateTypeRoot } from "./type.js";
|
|
6
|
+
export type validateParameterString<params extends string> = parseGenericParams<params> extends GenericParamsParseError<infer message> ? message : params;
|
|
7
|
+
export type GenericTypeInstantiation<params extends string[] = string[], def = any, $ = any> = <args>(...args: conform<args, {
|
|
8
|
+
[i in keyof params]: validateTypeRoot<args[i & keyof args], $>;
|
|
9
|
+
}>) => Type<inferDefinition<def, $, bindGenericInstantiation<params, $, args>>, $>;
|
|
10
|
+
export type GenericInstantiation<params extends string[] = string[], def = any, $ = any> = GenericTypeInstantiation<params, def, $> & GenericNodeInstantiation<params, def, $>;
|
|
11
|
+
type bindGenericInstantiation<params extends string[], $, args> = {
|
|
12
|
+
[i in keyof params & `${number}` as params[i]]: inferTypeRoot<args[i & keyof args], $>;
|
|
13
|
+
};
|
|
14
|
+
export declare class Generic<params extends string[] = string[], def = unknown, $ = any> extends Callable<GenericInstantiation<params, def, $>> implements GenericProps<params, def, $> {
|
|
15
|
+
params: params;
|
|
16
|
+
def: def;
|
|
17
|
+
$: SchemaScope<$>;
|
|
18
|
+
readonly [arkKind] = "generic";
|
|
19
|
+
constructor(params: params, def: def, $: SchemaScope<$>);
|
|
20
|
+
}
|
|
21
|
+
export {};
|
|
22
|
+
//# sourceMappingURL=generic.d.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,GAAG,EAAE,CAAC,CAAC,GAC3C,wBAAwB,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,CAAA;AAGzC,KAAK,wBAAwB,CAAC,MAAM,SAAS,MAAM,EAAE,EAAE,CAAC,EAAE,IAAI,IAAI;KAChE,CAAC,IAAI,MAAM,MAAM,GAAG,GAAG,MAAM,EAAE,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,aAAa,CAC5D,IAAI,CAAC,CAAC,GAAG,MAAM,IAAI,CAAC,EACpB,CAAC,CACD;CACD,CAAA;AAED,qBAAa,OAAO,CAAC,MAAM,SAAS,MAAM,EAAE,GAAG,MAAM,EAAE,EAAE,GAAG,GAAG,OAAO,EAAE,CAAC,GAAG,GAAG,CAC9E,SAAQ,QAAQ,CAAC,oBAAoB,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,CACrD,YAAW,YAAY,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC;IAK/B,MAAM,EAAE,MAAM;IACd,GAAG,EAAE,GAAG;IAER,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC;IANzB,QAAQ,CAAC,CAAC,OAAO,CAAC,aAAY;gBAGtB,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,GAAG,EAER,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC;CAUzB"}
|
package/out/generic.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { arkKind } from "@arktype/schema";
|
|
2
|
+
import { Callable, flatMorph } from "@arktype/util";
|
|
3
|
+
export class Generic extends Callable {
|
|
4
|
+
params;
|
|
5
|
+
def;
|
|
6
|
+
$;
|
|
7
|
+
[arkKind] = "generic";
|
|
8
|
+
constructor(params, def,
|
|
9
|
+
// TODO: should be Scope<$>, but breaks inference
|
|
10
|
+
$) {
|
|
11
|
+
super((...args) => {
|
|
12
|
+
const argNodes = flatMorph(params, (i, param) => [
|
|
13
|
+
param,
|
|
14
|
+
$.parseRoot(args[i])
|
|
15
|
+
]);
|
|
16
|
+
return $.parseRoot(def, { args: argNodes });
|
|
17
|
+
});
|
|
18
|
+
this.params = params;
|
|
19
|
+
this.def = def;
|
|
20
|
+
this.$ = $;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=generic.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generic.js","sourceRoot":"","sources":["../generic.ts"],"names":[],"mappings":"AAAA,OAAO,EAIN,OAAO,EACP,MAAM,iBAAiB,CAAA;AACxB,OAAO,EAAE,QAAQ,EAAgB,SAAS,EAAE,MAAM,eAAe,CAAA;AAwCjE,MAAM,OAAO,OACZ,SAAQ,QAA8C;IAM9C;IACA;IAEA;IANC,CAAC,OAAO,CAAC,GAAG,SAAS,CAAA;IAE9B,YACQ,MAAc,EACd,GAAQ;IACf,iDAAiD;IAC1C,CAAiB;QAExB,KAAK,CAAC,CAAC,GAAG,IAAe,EAAE,EAAE;YAC5B,MAAM,QAAQ,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,CAAC,EAAE,KAAa,EAAE,EAAE,CAAC;gBACxD,KAAK;gBACL,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;aACpB,CAAC,CAAA;YACF,OAAO,CAAC,CAAC,SAAS,CAAC,GAAG,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAU,CAAA;QACrD,CAAC,CAAC,CAAA;QAXK,WAAM,GAAN,MAAM,CAAQ;QACd,QAAG,GAAH,GAAG,CAAK;QAER,MAAC,GAAD,CAAC,CAAgB;IASzB,CAAC;CACD"}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
Constructor,
|
|
3
|
+
ErrorMessage,
|
|
4
|
+
List,
|
|
5
|
+
NonEnumerableDomain,
|
|
6
|
+
conform,
|
|
7
|
+
describe
|
|
8
|
+
} from "@arktype/util"
|
|
9
|
+
import type { Node, TypeNode } from "./base.js"
|
|
10
|
+
import type { isSchemaCast, schema } from "./builtins/builtins.js"
|
|
11
|
+
import type { Prerequisite } from "./kinds.js"
|
|
12
|
+
import type { ConstraintKind } from "./shared/implement.js"
|
|
13
|
+
import type { instantiateBasis } from "./types/basis.js"
|
|
14
|
+
import type { DomainNode, DomainSchema } from "./types/domain.js"
|
|
15
|
+
import type {
|
|
16
|
+
IntersectionNode,
|
|
17
|
+
IntersectionSchema
|
|
18
|
+
} from "./types/intersection.js"
|
|
19
|
+
import type {
|
|
20
|
+
Morph,
|
|
21
|
+
MorphChildDefinition,
|
|
22
|
+
MorphChildKind,
|
|
23
|
+
MorphSchema,
|
|
24
|
+
Out,
|
|
25
|
+
inferMorphOut
|
|
26
|
+
} from "./types/morph.js"
|
|
27
|
+
import type { ProtoNode, ProtoSchema } from "./types/proto.js"
|
|
28
|
+
import type { NormalizedUnionSchema, UnionChildNode } from "./types/union.js"
|
|
29
|
+
import type { UnitSchema } from "./types/unit.js"
|
|
30
|
+
export type validateAliases<aliases> = {
|
|
31
|
+
[k in keyof aliases]: "branches" extends keyof aliases[k]
|
|
32
|
+
? conform<aliases[k], NormalizedUnionSchema>
|
|
33
|
+
: aliases[k] extends readonly [...infer branches]
|
|
34
|
+
? {
|
|
35
|
+
[i in keyof branches]: validateSchemaBranch<
|
|
36
|
+
branches[i],
|
|
37
|
+
aliases
|
|
38
|
+
>
|
|
39
|
+
}
|
|
40
|
+
: validateSchemaBranch<aliases[k], aliases>
|
|
41
|
+
}
|
|
42
|
+
export type instantiateAliases<aliases> = {
|
|
43
|
+
[k in keyof aliases]: isSchemaCast<aliases[k]> extends true
|
|
44
|
+
? aliases[k] extends schema.cast<infer to, infer kind>
|
|
45
|
+
? TypeNode<to, kind>
|
|
46
|
+
: never
|
|
47
|
+
: aliases[k] extends NormalizedUnionSchema
|
|
48
|
+
? instantiateSchemaBranches<aliases[k]["branches"]>
|
|
49
|
+
: aliases[k] extends readonly [...infer branches]
|
|
50
|
+
? instantiateSchemaBranches<branches>
|
|
51
|
+
: instantiateSchemaBranch<aliases[k]>
|
|
52
|
+
} & unknown
|
|
53
|
+
export type validateSchemaBranch<def, $> = isSchemaCast<def> extends true
|
|
54
|
+
? def
|
|
55
|
+
: keyof def & ("morph" | "in" | "out") extends never
|
|
56
|
+
? validateMorphChild<def>
|
|
57
|
+
: validateMorphSchema<def>
|
|
58
|
+
export type instantiateSchemaBranches<branches extends List> =
|
|
59
|
+
branches["length"] extends 0
|
|
60
|
+
? TypeNode<never, "union">
|
|
61
|
+
: branches["length"] extends 1
|
|
62
|
+
? instantiateSchemaBranch<branches[0]>
|
|
63
|
+
: TypeNode<instantiateSchemaBranch<branches[number]>["infer"]>
|
|
64
|
+
export type instantiateSchemaBranch<def> = isSchemaCast<def> extends true
|
|
65
|
+
? def extends schema.cast<infer to, infer kind>
|
|
66
|
+
? TypeNode<to, kind>
|
|
67
|
+
: never
|
|
68
|
+
: def extends MorphSchema
|
|
69
|
+
? instantiateMorphSchema<def>
|
|
70
|
+
: def extends MorphChildDefinition
|
|
71
|
+
? instantiateMorphChild<def>
|
|
72
|
+
: UnionChildNode
|
|
73
|
+
type NonIntersectableBasisSchema =
|
|
74
|
+
| NonEnumerableDomain
|
|
75
|
+
| Constructor
|
|
76
|
+
| UnitSchema
|
|
77
|
+
export type validateMorphChild<def> = [def] extends [
|
|
78
|
+
NonIntersectableBasisSchema
|
|
79
|
+
]
|
|
80
|
+
? def
|
|
81
|
+
: validateIntersectionSchema<def>
|
|
82
|
+
export type instantiateMorphChild<def> = def extends NonIntersectableBasisSchema
|
|
83
|
+
? instantiateBasis<def>
|
|
84
|
+
: def extends IntersectionSchema
|
|
85
|
+
? instantiateIntersectionSchema<def>
|
|
86
|
+
: Node<MorphChildKind>
|
|
87
|
+
export type validateMorphSchema<def> = {
|
|
88
|
+
[k in keyof def]: k extends "in" | "out"
|
|
89
|
+
? validateMorphChild<def[k]>
|
|
90
|
+
: k extends keyof MorphSchema
|
|
91
|
+
? MorphSchema[k]
|
|
92
|
+
: `'${k & string}' is not a valid morph schema key`
|
|
93
|
+
}
|
|
94
|
+
export type instantiateMorphSchema<def> = def extends MorphSchema
|
|
95
|
+
? TypeNode<
|
|
96
|
+
(
|
|
97
|
+
In: def["in"] extends {}
|
|
98
|
+
? instantiateMorphChild<def["in"]>["infer"]
|
|
99
|
+
: unknown
|
|
100
|
+
) => def["out"] extends {}
|
|
101
|
+
? Out<instantiateMorphChild<def["out"]>["infer"]>
|
|
102
|
+
: def["morph"] extends
|
|
103
|
+
| Morph<any, infer o>
|
|
104
|
+
| readonly [...unknown[], Morph<any, infer o>]
|
|
105
|
+
? Out<inferMorphOut<o>>
|
|
106
|
+
: never,
|
|
107
|
+
"morph"
|
|
108
|
+
>
|
|
109
|
+
: never
|
|
110
|
+
type exactBasisMessageOnError<def, expected> = {
|
|
111
|
+
[k in keyof def]: k extends keyof expected
|
|
112
|
+
? conform<def[k], expected[k]>
|
|
113
|
+
: ErrorMessage<
|
|
114
|
+
k extends ConstraintKind
|
|
115
|
+
? `${k} has a prerequisite of ${describe<Prerequisite<k>>}`
|
|
116
|
+
: `'${k & string}' is not on an intersection schema`
|
|
117
|
+
>
|
|
118
|
+
}
|
|
119
|
+
export type validateIntersectionSchema<schema> = exactBasisMessageOnError<
|
|
120
|
+
schema,
|
|
121
|
+
IntersectionSchema<inferBasisOf<schema>>
|
|
122
|
+
>
|
|
123
|
+
type inferBasisOf<schema> = "proto" extends keyof schema
|
|
124
|
+
? instantiateBasis<conform<schema["proto"], ProtoSchema>>["infer"]
|
|
125
|
+
: "domain" extends keyof schema
|
|
126
|
+
? instantiateBasis<conform<schema["domain"], DomainSchema>>["infer"]
|
|
127
|
+
: unknown
|
|
128
|
+
export type instantiateIntersectionSchema<def> = keyof def &
|
|
129
|
+
ConstraintKind extends never
|
|
130
|
+
? "proto" extends keyof def
|
|
131
|
+
? ProtoNode<inferBasisOf<def>>
|
|
132
|
+
: "domain" extends keyof def
|
|
133
|
+
? DomainNode<inferBasisOf<def>>
|
|
134
|
+
: IntersectionNode
|
|
135
|
+
: IntersectionNode<inferBasisOf<def>>
|
|
136
|
+
export {}
|
|
137
|
+
//# sourceMappingURL=inference.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inference.d.ts","sourceRoot":"","sources":["../inference.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,WAAW,EACX,YAAY,EACZ,IAAI,EACJ,mBAAmB,EACnB,OAAO,EACP,QAAQ,EACR,MAAM,eAAe,CAAA;AACtB,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AAC/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAClE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAC9C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAC3D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AACxD,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AACjE,OAAO,KAAK,EACX,gBAAgB,EAChB,kBAAkB,EAClB,MAAM,yBAAyB,CAAA;AAChC,OAAO,KAAK,EACX,KAAK,EACL,oBAAoB,EACpB,cAAc,EACd,WAAW,EACX,GAAG,EACH,aAAa,EACb,MAAM,kBAAkB,CAAA;AACzB,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAC9D,OAAO,KAAK,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAC7E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAEjD,MAAM,MAAM,eAAe,CAAC,OAAO,IAAI;KACrC,CAAC,IAAI,MAAM,OAAO,GAAG,UAAU,SAAS,MAAM,OAAO,CAAC,CAAC,CAAC,GACtD,OAAO,CAAC,OAAO,CAAC,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AW,CAAC,CAAC,CAAC,OAAO,CAAC,GAChE,QAAQ,SAAS,MAAM,MAAM,GAC7B,gBAAgB,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,OAAO,CAAC,GAClE,OAAO,CAAA;AAEV,MAAM,MAAM,6BAA6B,CAAC,GAAG,IAAI,MAAM,GAAG,GACzD,cAAc,SAAS,KAAK,GAC1B,OAAO,SAAS,MAAM,GAAG,GACxB,SAAS,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,GAC5B,QAAQ,SAAS,MAAM,GAAG,GAC1B,UAAU,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,GAC7B,gBAAgB,GACjB,gBAAgB,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,CAAA"}
|
package/out/inference.js
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
export {}
|
|
2
|
+
// export type inferPropsInput<input extends PropsInput> =
|
|
3
|
+
// input extends PropsInputTuple<infer named, infer indexed>
|
|
4
|
+
// ? inferIndexed<indexed, inferNamedProps<named, indexed>>
|
|
5
|
+
// : input extends NamedPropsInput
|
|
6
|
+
// ? inferNamedProps<input, []>
|
|
7
|
+
// : never
|
|
8
|
+
// type inferIndexed<
|
|
9
|
+
// indexed extends readonly IndexedPropInput[],
|
|
10
|
+
// result = unknown
|
|
11
|
+
// > = indexed extends readonly [
|
|
12
|
+
// infer entry extends IndexedPropInput,
|
|
13
|
+
// ...infer tail extends IndexedPropInput[]
|
|
14
|
+
// ]
|
|
15
|
+
// ? inferIndexed<
|
|
16
|
+
// tail,
|
|
17
|
+
// entry["key"] extends { readonly regex: VariadicIndexMatcherLiteral }
|
|
18
|
+
// ? result extends List
|
|
19
|
+
// ? [...result, ...inferTypeInput<entry["value"]>[]]
|
|
20
|
+
// : never
|
|
21
|
+
// : entry["key"] extends {
|
|
22
|
+
// readonly regex: NonVariadicIndexMatcherLiteral
|
|
23
|
+
// }
|
|
24
|
+
// ? inferTypeInput<entry["value"]>[]
|
|
25
|
+
// : Record<
|
|
26
|
+
// Extract<inferTypeInput<entry["key"]>, PropertyKey>,
|
|
27
|
+
// inferTypeInput<entry["value"]>
|
|
28
|
+
// >
|
|
29
|
+
// >
|
|
30
|
+
// : result
|
|
31
|
+
// type inferNamedProps<
|
|
32
|
+
// named extends NamedPropsInput,
|
|
33
|
+
// indexed extends readonly IndexedPropInput[]
|
|
34
|
+
// > = [named, indexed[0]["key"]] extends
|
|
35
|
+
// | [TupleLengthProps, unknown]
|
|
36
|
+
// | [unknown, { readonly regex: VariadicIndexMatcherLiteral }]
|
|
37
|
+
// ? inferNonVariadicTupleProps<named> &
|
|
38
|
+
// inferObjectLiteralProps<Omit<named, "length" | NumberLiteral | number>>
|
|
39
|
+
// : inferObjectLiteralProps<named>
|
|
40
|
+
// type inferObjectLiteralProps<named extends NamedPropsInput> = {} extends named
|
|
41
|
+
// ? unknown
|
|
42
|
+
// : evaluate<
|
|
43
|
+
// {
|
|
44
|
+
// [k in requiredKeyOf<named>]: inferPropValue<named[k]["value"]>
|
|
45
|
+
// } & {
|
|
46
|
+
// [k in optionalKeyOf<named>]?: inferPropValue<named[k]["value"]>
|
|
47
|
+
// }
|
|
48
|
+
// >
|
|
49
|
+
// type inferPropValue<value extends PropValueInput> = value extends Thunk<
|
|
50
|
+
// infer ret
|
|
51
|
+
// >
|
|
52
|
+
// ? inferResolvedPropValue<ret>
|
|
53
|
+
// : inferResolvedPropValue<value>
|
|
54
|
+
// type inferResolvedPropValue<value> = value extends TypeNode<infer t>
|
|
55
|
+
// ? t
|
|
56
|
+
// : inferTypeInput<Extract<value, TypeInput>>
|
|
57
|
+
// type stringifiedNumericKeyOf<t> = `${Extract<keyof t, number | NumberLiteral>}`
|
|
58
|
+
// type inferNonVariadicTupleProps<
|
|
59
|
+
// named extends NamedPropsInput,
|
|
60
|
+
// result extends unknown[] = []
|
|
61
|
+
// > = `${result["length"]}` extends stringifiedNumericKeyOf<named>
|
|
62
|
+
// ? inferNonVariadicTupleProps<
|
|
63
|
+
// named,
|
|
64
|
+
// [...result, inferPropValue<named[`${result["length"]}`]["value"]>]
|
|
65
|
+
// >
|
|
66
|
+
// : result
|
|
67
|
+
// type TupleLengthProps<length extends number = number> = {
|
|
68
|
+
// readonly length: {
|
|
69
|
+
// readonly prerequisite: true
|
|
70
|
+
// readonly value: { readonly basis: readonly ["===", length] }
|
|
71
|
+
// }
|
|
72
|
+
// }
|
|
73
|
+
//# sourceMappingURL=inference.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inference.js","sourceRoot":"","sources":["../inference.ts"],"names":[],"mappings":";AAmJA,0DAA0D;AAC1D,6DAA6D;AAC7D,6DAA6D;AAC7D,oCAAoC;AACpC,iCAAiC;AACjC,YAAY;AAEZ,qBAAqB;AACrB,gDAAgD;AAChD,oBAAoB;AACpB,iCAAiC;AACjC,yCAAyC;AACzC,4CAA4C;AAC5C,IAAI;AACJ,mBAAmB;AACnB,WAAW;AACX,0EAA0E;AAC1E,4BAA4B;AAC5B,0DAA0D;AAC1D,eAAe;AACf,+BAA+B;AAC/B,uDAAuD;AACvD,UAAU;AACV,yCAAyC;AACzC,gBAAgB;AAChB,4DAA4D;AAC5D,uCAAuC;AACvC,UAAU;AACV,OAAO;AACP,YAAY;AAEZ,wBAAwB;AACxB,kCAAkC;AAClC,+CAA+C;AAC/C,yCAAyC;AACzC,iCAAiC;AACjC,gEAAgE;AAChE,yCAAyC;AACzC,6EAA6E;AAC7E,oCAAoC;AAEpC,iFAAiF;AACjF,aAAa;AACb,eAAe;AACf,OAAO;AACP,qEAAqE;AACrE,WAAW;AACX,sEAAsE;AACtE,OAAO;AACP,OAAO;AAEP,2EAA2E;AAC3E,aAAa;AACb,IAAI;AACJ,iCAAiC;AACjC,mCAAmC;AAEnC,uEAAuE;AACvE,OAAO;AACP,+CAA+C;AAE/C,kFAAkF;AAElF,mCAAmC;AACnC,kCAAkC;AAClC,iCAAiC;AACjC,mEAAmE;AACnE,iCAAiC;AACjC,YAAY;AACZ,wEAAwE;AACxE,OAAO;AACP,YAAY;AAEZ,4DAA4D;AAC5D,sBAAsB;AACtB,gCAAgC;AAChC,iEAAiE;AACjE,KAAK;AACL,IAAI"}
|