arktype 2.0.0-dev.8 → 2.0.0-dev.9
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__/config.test.ts +11 -0
- package/__tests__/imports.test.ts +18 -12
- package/__tests__/literal.test.ts +30 -14
- package/__tests__/narrow.test.ts +2 -2
- package/__tests__/objectLiteral.test.ts +130 -7
- package/__tests__/pipe.test.ts +1 -1
- package/__tests__/scope.test.ts +197 -0
- package/__tests__/traverse.test.ts +13 -5
- package/out/ark.d.ts +1 -2
- package/out/ark.js +0 -1
- package/out/generic.d.ts +0 -1
- package/out/generic.js +0 -1
- package/out/main.d.ts +0 -1
- package/out/main.js +0 -1
- package/out/match.d.ts +0 -1
- package/out/match.js +0 -1
- package/out/module.d.ts +0 -1
- package/out/module.js +0 -1
- package/out/parser/definition.d.ts +1 -2
- package/out/parser/definition.js +0 -1
- package/out/parser/generic.d.ts +2 -3
- package/out/parser/generic.js +0 -1
- package/out/parser/generic.js.map +1 -1
- package/out/parser/objectLiteral.d.ts +1 -2
- package/out/parser/objectLiteral.js +15 -8
- package/out/parser/objectLiteral.js.map +1 -1
- package/out/parser/semantic/bounds.d.ts +1 -2
- package/out/parser/semantic/bounds.js +0 -1
- package/out/parser/semantic/divisor.d.ts +0 -1
- package/out/parser/semantic/divisor.js +0 -2
- package/out/parser/semantic/infer.d.ts +0 -1
- package/out/parser/semantic/infer.js +0 -2
- package/out/parser/semantic/utils.d.ts +0 -1
- package/out/parser/semantic/utils.js +0 -2
- package/out/parser/semantic/validate.d.ts +2 -3
- package/out/parser/semantic/validate.js +0 -1
- package/out/parser/string/reduce/dynamic.d.ts +0 -1
- package/out/parser/string/reduce/dynamic.js +0 -1
- package/out/parser/string/reduce/shared.d.ts +5 -18
- package/out/parser/string/reduce/shared.js +0 -1
- package/out/parser/string/reduce/static.d.ts +0 -1
- package/out/parser/string/reduce/static.js +0 -2
- package/out/parser/string/shift/operand/date.d.ts +2 -3
- package/out/parser/string/shift/operand/date.js +0 -1
- package/out/parser/string/shift/operand/enclosed.d.ts +2 -17
- package/out/parser/string/shift/operand/enclosed.js +0 -1
- package/out/parser/string/shift/operand/genericArgs.d.ts +1 -2
- package/out/parser/string/shift/operand/genericArgs.js +0 -1
- package/out/parser/string/shift/operand/operand.d.ts +0 -1
- package/out/parser/string/shift/operand/operand.js +0 -1
- package/out/parser/string/shift/operand/unenclosed.d.ts +2 -3
- package/out/parser/string/shift/operand/unenclosed.js +1 -3
- package/out/parser/string/shift/operand/unenclosed.js.map +1 -1
- package/out/parser/string/shift/operator/bounds.d.ts +1 -8
- package/out/parser/string/shift/operator/bounds.js +0 -1
- package/out/parser/string/shift/operator/divisor.d.ts +1 -2
- package/out/parser/string/shift/operator/divisor.js +0 -1
- package/out/parser/string/shift/operator/operator.d.ts +1 -2
- package/out/parser/string/shift/operator/operator.js +0 -1
- package/out/parser/string/shift/scanner.d.ts +0 -1
- package/out/parser/string/shift/scanner.js +0 -1
- package/out/parser/string/string.d.ts +0 -1
- package/out/parser/string/string.js +0 -1
- package/out/parser/tuple.d.ts +1 -2
- package/out/parser/tuple.js +0 -1
- package/out/scope.d.ts +6 -6
- package/out/scope.js +6 -6
- package/out/scope.js.map +1 -1
- package/out/type.d.ts +0 -1
- package/out/type.js +0 -1
- package/out/type.js.map +1 -1
- package/package.json +6 -4
- package/parser/generic.ts +2 -2
- package/parser/objectLiteral.ts +23 -7
- package/parser/string/shift/operand/unenclosed.ts +1 -2
- package/scope.ts +18 -12
- package/type.ts +1 -0
- package/__tests__/cyclic.test.ts +0 -148
- package/out/ark.d.ts.map +0 -1
- package/out/base.d.ts +0 -205
- package/out/base.d.ts.map +0 -1
- package/out/base.js +0 -320
- package/out/base.js.map +0 -1
- package/out/builtins/builtins.d.ts +0 -23
- package/out/builtins/builtins.d.ts.map +0 -1
- package/out/builtins/builtins.js +0 -15
- package/out/builtins/builtins.js.map +0 -1
- package/out/builtins/jsObjects.d.ts +0 -19
- package/out/builtins/jsObjects.d.ts.map +0 -1
- package/out/builtins/jsObjects.js +0 -18
- package/out/builtins/jsObjects.js.map +0 -1
- package/out/builtins/parsing.d.ts +0 -16
- package/out/builtins/parsing.d.ts.map +0 -1
- package/out/builtins/parsing.js +0 -62
- package/out/builtins/parsing.js.map +0 -1
- package/out/builtins/tsGenerics.d.ts +0 -2
- package/out/builtins/tsGenerics.d.ts.map +0 -1
- package/out/builtins/tsGenerics.js +0 -26
- package/out/builtins/tsGenerics.js.map +0 -1
- package/out/builtins/tsKeywords.d.ts +0 -23
- package/out/builtins/tsKeywords.d.ts.map +0 -1
- package/out/builtins/tsKeywords.js +0 -23
- package/out/builtins/tsKeywords.js.map +0 -1
- package/out/builtins/utils/creditCard.d.ts +0 -3
- package/out/builtins/utils/creditCard.d.ts.map +0 -1
- package/out/builtins/utils/creditCard.js +0 -35
- package/out/builtins/utils/creditCard.js.map +0 -1
- package/out/builtins/utils/date.d.ts +0 -41
- package/out/builtins/utils/date.d.ts.map +0 -1
- package/out/builtins/utils/date.js +0 -56
- package/out/builtins/utils/date.js.map +0 -1
- package/out/builtins/validation.d.ts +0 -19
- package/out/builtins/validation.d.ts.map +0 -1
- package/out/builtins/validation.js +0 -74
- package/out/builtins/validation.js.map +0 -1
- package/out/config.d.ts +0 -9
- package/out/config.d.ts.map +0 -1
- package/out/config.js +0 -18
- package/out/config.js.map +0 -1
- package/out/constraints/ast.d.ts +0 -287
- package/out/constraints/ast.d.ts.map +0 -1
- package/out/constraints/ast.js +0 -2
- package/out/constraints/ast.js.map +0 -1
- package/out/constraints/constraint.d.ts +0 -200
- package/out/constraints/constraint.d.ts.map +0 -1
- package/out/constraints/constraint.js +0 -25
- package/out/constraints/constraint.js.map +0 -1
- package/out/constraints/predicate.d.ts +0 -64
- package/out/constraints/predicate.d.ts.map +0 -1
- package/out/constraints/predicate.js +0 -52
- package/out/constraints/predicate.js.map +0 -1
- package/out/constraints/props/index.d.ts +0 -42
- package/out/constraints/props/index.d.ts.map +0 -1
- package/out/constraints/props/index.js +0 -56
- package/out/constraints/props/index.js.map +0 -1
- package/out/constraints/props/optional.d.ts +0 -37
- package/out/constraints/props/optional.d.ts.map +0 -1
- package/out/constraints/props/optional.js +0 -56
- package/out/constraints/props/optional.js.map +0 -1
- package/out/constraints/props/prop.d.ts +0 -49
- package/out/constraints/props/prop.d.ts.map +0 -1
- package/out/constraints/props/prop.js +0 -106
- package/out/constraints/props/prop.js.map +0 -1
- package/out/constraints/props/props.d.ts +0 -37
- package/out/constraints/props/props.d.ts.map +0 -1
- package/out/constraints/props/props.js +0 -121
- package/out/constraints/props/props.js.map +0 -1
- package/out/constraints/props/required.d.ts +0 -46
- package/out/constraints/props/required.d.ts.map +0 -1
- package/out/constraints/props/required.js +0 -81
- package/out/constraints/props/required.js.map +0 -1
- package/out/constraints/props/sequence.d.ts +0 -82
- package/out/constraints/props/sequence.d.ts.map +0 -1
- package/out/constraints/props/sequence.js +0 -376
- package/out/constraints/props/sequence.js.map +0 -1
- package/out/constraints/props/shared.d.ts +0 -3
- package/out/constraints/props/shared.d.ts.map +0 -1
- package/out/constraints/props/shared.js +0 -4
- package/out/constraints/props/shared.js.map +0 -1
- package/out/constraints/refinements/after.d.ts +0 -33
- package/out/constraints/refinements/after.d.ts.map +0 -1
- package/out/constraints/refinements/after.js +0 -36
- package/out/constraints/refinements/after.js.map +0 -1
- package/out/constraints/refinements/before.d.ts +0 -33
- package/out/constraints/refinements/before.d.ts.map +0 -1
- package/out/constraints/refinements/before.js +0 -43
- package/out/constraints/refinements/before.js.map +0 -1
- package/out/constraints/refinements/divisor.d.ts +0 -52
- package/out/constraints/refinements/divisor.d.ts.map +0 -1
- package/out/constraints/refinements/divisor.js +0 -52
- package/out/constraints/refinements/divisor.js.map +0 -1
- package/out/constraints/refinements/exactLength.d.ts +0 -45
- package/out/constraints/refinements/exactLength.d.ts.map +0 -1
- package/out/constraints/refinements/exactLength.js +0 -52
- package/out/constraints/refinements/exactLength.js.map +0 -1
- package/out/constraints/refinements/kinds.d.ts +0 -29
- package/out/constraints/refinements/kinds.d.ts.map +0 -1
- package/out/constraints/refinements/kinds.js +0 -17
- package/out/constraints/refinements/kinds.js.map +0 -1
- package/out/constraints/refinements/length.d.ts +0 -48
- package/out/constraints/refinements/length.d.ts.map +0 -1
- package/out/constraints/refinements/length.js +0 -53
- package/out/constraints/refinements/length.js.map +0 -1
- package/out/constraints/refinements/max.d.ts +0 -31
- package/out/constraints/refinements/max.d.ts.map +0 -1
- package/out/constraints/refinements/max.js +0 -35
- package/out/constraints/refinements/max.js.map +0 -1
- package/out/constraints/refinements/maxLength.d.ts +0 -32
- package/out/constraints/refinements/maxLength.d.ts.map +0 -1
- package/out/constraints/refinements/maxLength.js +0 -36
- package/out/constraints/refinements/maxLength.js.map +0 -1
- package/out/constraints/refinements/min.d.ts +0 -31
- package/out/constraints/refinements/min.d.ts.map +0 -1
- package/out/constraints/refinements/min.js +0 -28
- package/out/constraints/refinements/min.js.map +0 -1
- package/out/constraints/refinements/minLength.d.ts +0 -32
- package/out/constraints/refinements/minLength.d.ts.map +0 -1
- package/out/constraints/refinements/minLength.js +0 -33
- package/out/constraints/refinements/minLength.js.map +0 -1
- package/out/constraints/refinements/range.d.ts +0 -119
- package/out/constraints/refinements/range.d.ts.map +0 -1
- package/out/constraints/refinements/range.js +0 -89
- package/out/constraints/refinements/range.js.map +0 -1
- package/out/constraints/refinements/regex.d.ts +0 -47
- package/out/constraints/refinements/regex.d.ts.map +0 -1
- package/out/constraints/refinements/regex.js +0 -37
- package/out/constraints/refinements/regex.js.map +0 -1
- package/out/constraints/refinements/shared.d.ts +0 -20
- package/out/constraints/refinements/shared.d.ts.map +0 -1
- package/out/constraints/refinements/shared.js +0 -10
- package/out/constraints/refinements/shared.js.map +0 -1
- package/out/generic.d.ts.map +0 -1
- package/out/inference.d.ts +0 -137
- package/out/inference.d.ts.map +0 -1
- package/out/inference.js +0 -73
- package/out/inference.js.map +0 -1
- package/out/keywords/ark.d.ts +0 -70
- package/out/keywords/ark.d.ts.map +0 -1
- package/out/keywords/ark.js +0 -29
- package/out/keywords/ark.js.map +0 -1
- package/out/keywords/internal.d.ts +0 -13
- package/out/keywords/internal.d.ts.map +0 -1
- package/out/keywords/internal.js +0 -13
- package/out/keywords/internal.js.map +0 -1
- package/out/keywords/jsObject.d.ts +0 -20
- package/out/keywords/jsObject.d.ts.map +0 -1
- package/out/keywords/jsObject.js +0 -18
- package/out/keywords/jsObject.js.map +0 -1
- package/out/keywords/parsing.d.ts +0 -17
- package/out/keywords/parsing.d.ts.map +0 -1
- package/out/keywords/parsing.js +0 -64
- package/out/keywords/parsing.js.map +0 -1
- package/out/keywords/root.d.ts +0 -7
- package/out/keywords/root.d.ts.map +0 -1
- package/out/keywords/root.js +0 -4
- package/out/keywords/root.js.map +0 -1
- package/out/keywords/tsGenerics.d.ts +0 -2
- package/out/keywords/tsGenerics.d.ts.map +0 -1
- package/out/keywords/tsGenerics.js +0 -26
- package/out/keywords/tsGenerics.js.map +0 -1
- package/out/keywords/tsPrimitive.d.ts +0 -24
- package/out/keywords/tsPrimitive.d.ts.map +0 -1
- package/out/keywords/tsPrimitive.js +0 -25
- package/out/keywords/tsPrimitive.js.map +0 -1
- package/out/keywords/utils/creditCard.d.ts +0 -11
- package/out/keywords/utils/creditCard.d.ts.map +0 -1
- package/out/keywords/utils/creditCard.js +0 -35
- package/out/keywords/utils/creditCard.js.map +0 -1
- package/out/keywords/utils/date.d.ts +0 -45
- package/out/keywords/utils/date.d.ts.map +0 -1
- package/out/keywords/utils/date.js +0 -56
- package/out/keywords/utils/date.js.map +0 -1
- package/out/keywords/validation.d.ts +0 -20
- package/out/keywords/validation.d.ts.map +0 -1
- package/out/keywords/validation.js +0 -80
- package/out/keywords/validation.js.map +0 -1
- package/out/kinds.d.ts +0 -102
- package/out/kinds.d.ts.map +0 -1
- package/out/kinds.js +0 -29
- package/out/kinds.js.map +0 -1
- package/out/main.d.ts.map +0 -1
- package/out/match.d.ts.map +0 -1
- package/out/module.d.ts.map +0 -1
- package/out/parse.d.ts +0 -29
- package/out/parse.d.ts.map +0 -1
- package/out/parse.js +0 -161
- package/out/parse.js.map +0 -1
- package/out/parser/definition.d.ts.map +0 -1
- package/out/parser/generic.d.ts.map +0 -1
- package/out/parser/objectLiteral.d.ts.map +0 -1
- package/out/parser/semantic/bounds.d.ts.map +0 -1
- package/out/parser/semantic/divisor.d.ts.map +0 -1
- package/out/parser/semantic/infer.d.ts.map +0 -1
- package/out/parser/semantic/utils.d.ts.map +0 -1
- package/out/parser/semantic/validate.d.ts.map +0 -1
- package/out/parser/string/reduce/dynamic.d.ts.map +0 -1
- package/out/parser/string/reduce/shared.d.ts.map +0 -1
- package/out/parser/string/reduce/static.d.ts.map +0 -1
- package/out/parser/string/shift/operand/date.d.ts.map +0 -1
- package/out/parser/string/shift/operand/enclosed.d.ts.map +0 -1
- package/out/parser/string/shift/operand/genericArgs.d.ts.map +0 -1
- package/out/parser/string/shift/operand/operand.d.ts.map +0 -1
- package/out/parser/string/shift/operand/unenclosed.d.ts.map +0 -1
- package/out/parser/string/shift/operator/bounds.d.ts.map +0 -1
- package/out/parser/string/shift/operator/divisor.d.ts.map +0 -1
- package/out/parser/string/shift/operator/operator.d.ts.map +0 -1
- package/out/parser/string/shift/scanner.d.ts.map +0 -1
- package/out/parser/string/string.d.ts.map +0 -1
- package/out/parser/tuple.d.ts.map +0 -1
- package/out/schema.d.ts +0 -175
- package/out/schema.d.ts.map +0 -1
- package/out/schema.js +0 -73
- package/out/schema.js.map +0 -1
- package/out/schemaScope.d.ts +0 -180
- package/out/schemaScope.d.ts.map +0 -1
- package/out/schemaScope.js +0 -235
- package/out/schemaScope.js.map +0 -1
- package/out/scope.d.ts.map +0 -1
- package/out/shared/compile.d.ts +0 -22
- package/out/shared/compile.d.ts.map +0 -1
- package/out/shared/compile.js +0 -79
- package/out/shared/compile.js.map +0 -1
- package/out/shared/context.d.ts +0 -54
- package/out/shared/context.d.ts.map +0 -1
- package/out/shared/context.js +0 -53
- package/out/shared/context.js.map +0 -1
- package/out/shared/declare.d.ts +0 -69
- package/out/shared/declare.d.ts.map +0 -1
- package/out/shared/declare.js +0 -2
- package/out/shared/declare.js.map +0 -1
- package/out/shared/disjoint.d.ts +0 -91
- package/out/shared/disjoint.d.ts.map +0 -1
- package/out/shared/disjoint.js +0 -110
- package/out/shared/disjoint.js.map +0 -1
- package/out/shared/errors.d.ts +0 -99
- package/out/shared/errors.d.ts.map +0 -1
- package/out/shared/errors.js +0 -108
- package/out/shared/errors.js.map +0 -1
- package/out/shared/implement.d.ts +0 -363
- package/out/shared/implement.d.ts.map +0 -1
- package/out/shared/implement.js +0 -68
- package/out/shared/implement.js.map +0 -1
- package/out/shared/inference.d.ts +0 -6
- package/out/shared/inference.d.ts.map +0 -1
- package/out/shared/inference.js +0 -5
- package/out/shared/inference.js.map +0 -1
- package/out/shared/intersections.d.ts +0 -60
- package/out/shared/intersections.d.ts.map +0 -1
- package/out/shared/intersections.js +0 -2
- package/out/shared/intersections.js.map +0 -1
- package/out/shared/traversal.d.ts +0 -62
- package/out/shared/traversal.d.ts.map +0 -1
- package/out/shared/traversal.js +0 -97
- package/out/shared/traversal.js.map +0 -1
- package/out/shared/utils.d.ts +0 -24
- package/out/shared/utils.d.ts.map +0 -1
- package/out/shared/utils.js +0 -15
- package/out/shared/utils.js.map +0 -1
- package/out/type.d.ts.map +0 -1
- package/out/types/basis.d.ts +0 -47
- package/out/types/basis.d.ts.map +0 -1
- package/out/types/basis.js +0 -15
- package/out/types/basis.js.map +0 -1
- package/out/types/discriminate.d.ts +0 -34
- package/out/types/discriminate.d.ts.map +0 -1
- package/out/types/discriminate.js +0 -120
- package/out/types/discriminate.js.map +0 -1
- package/out/types/domain.d.ts +0 -57
- package/out/types/domain.d.ts.map +0 -1
- package/out/types/domain.js +0 -41
- package/out/types/domain.js.map +0 -1
- package/out/types/intersection.d.ts +0 -127
- package/out/types/intersection.d.ts.map +0 -1
- package/out/types/intersection.js +0 -379
- package/out/types/intersection.js.map +0 -1
- package/out/types/morph.d.ts +0 -157
- package/out/types/morph.d.ts.map +0 -1
- package/out/types/morph.js +0 -99
- package/out/types/morph.js.map +0 -1
- package/out/types/proto.d.ts +0 -51
- package/out/types/proto.d.ts.map +0 -1
- package/out/types/proto.js +0 -60
- package/out/types/proto.js.map +0 -1
- package/out/types/type.d.ts +0 -143
- package/out/types/type.d.ts.map +0 -1
- package/out/types/type.js +0 -123
- package/out/types/type.js.map +0 -1
- package/out/types/union.d.ts +0 -71
- package/out/types/union.d.ts.map +0 -1
- package/out/types/union.js +0 -379
- package/out/types/union.js.map +0 -1
- package/out/types/unit.d.ts +0 -45
- package/out/types/unit.d.ts.map +0 -1
- package/out/types/unit.js +0 -56
- package/out/types/unit.js.map +0 -1
- package/out/util.d.ts +0 -31
- package/out/util.d.ts.map +0 -1
- package/out/util.js +0 -8
- package/out/util.js.map +0 -1
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
BasePrimitiveConstraint,
|
|
3
|
-
writeInvalidOperandMessage
|
|
4
|
-
} from "../constraint.js"
|
|
5
|
-
export class DivisorNode extends BasePrimitiveConstraint {
|
|
6
|
-
static implementation = this.implement({
|
|
7
|
-
collapsibleKey: "rule",
|
|
8
|
-
keys: {
|
|
9
|
-
rule: {}
|
|
10
|
-
},
|
|
11
|
-
normalize: (schema) =>
|
|
12
|
-
typeof schema === "number" ? { rule: schema } : schema,
|
|
13
|
-
intersections: {
|
|
14
|
-
divisor: (l, r, $) =>
|
|
15
|
-
$.node("divisor", {
|
|
16
|
-
rule: Math.abs(
|
|
17
|
-
(l.rule * r.rule) /
|
|
18
|
-
greatestCommonDivisor(l.rule, r.rule)
|
|
19
|
-
)
|
|
20
|
-
})
|
|
21
|
-
},
|
|
22
|
-
hasAssociatedError: true,
|
|
23
|
-
defaults: {
|
|
24
|
-
description(node) {
|
|
25
|
-
return node.rule === 1
|
|
26
|
-
? "an integer"
|
|
27
|
-
: `a multiple of ${node.rule}`
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
})
|
|
31
|
-
traverseAllows = (data) => data % this.rule === 0
|
|
32
|
-
compiledCondition = `data % ${this.rule} === 0`
|
|
33
|
-
compiledNegation = `data % ${this.rule} !== 0`
|
|
34
|
-
impliedBasis = this.$.keywords.number
|
|
35
|
-
errorContext = this.createErrorContext(this.inner)
|
|
36
|
-
expression = `% ${this.rule}`
|
|
37
|
-
}
|
|
38
|
-
export const writeIndivisibleMessage = (t) =>
|
|
39
|
-
writeInvalidOperandMessage("divisor", t.$.keywords.number, t)
|
|
40
|
-
// https://en.wikipedia.org/wiki/Euclidean_algorithm
|
|
41
|
-
const greatestCommonDivisor = (l, r) => {
|
|
42
|
-
let previous
|
|
43
|
-
let greatestCommonDivisor = l
|
|
44
|
-
let current = r
|
|
45
|
-
while (current !== 0) {
|
|
46
|
-
previous = current
|
|
47
|
-
current = greatestCommonDivisor % current
|
|
48
|
-
greatestCommonDivisor = previous
|
|
49
|
-
}
|
|
50
|
-
return greatestCommonDivisor
|
|
51
|
-
}
|
|
52
|
-
//# sourceMappingURL=divisor.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"divisor.js","sourceRoot":"","sources":["../../../constraints/refinements/divisor.ts"],"names":[],"mappings":"AAGA,OAAO,EACN,uBAAuB,EACvB,0BAA0B,EAC1B,MAAM,kBAAkB,CAAA;AAiBzB,MAAM,OAAO,WAAY,SAAQ,uBAA2C;IAC3E,MAAM,CAAC,cAAc,GAAG,IAAI,CAAC,SAAS,CAAC;QACtC,cAAc,EAAE,MAAM;QACtB,IAAI,EAAE;YACL,IAAI,EAAE,EAAE;SACR;QACD,SAAS,EAAE,CAAC,MAAM,EAAE,EAAE,CACrB,OAAO,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,MAAM;QACvD,aAAa,EAAE;YACd,OAAO,EAAE,CAAC,CAAC,EAA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AC,CAAA;IACf,OAAO,OAAO,KAAK,CAAC,EAAE,CAAC;QACtB,QAAQ,GAAG,OAAO,CAAA;QAClB,OAAO,GAAG,qBAAqB,GAAG,OAAO,CAAA;QACzC,qBAAqB,GAAG,QAAQ,CAAA;IACjC,CAAC;IACD,OAAO,qBAAqB,CAAA;AAC7B,CAAC,CAAA"}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import type { BaseMeta, declareNode } from "../../shared/declare.js"
|
|
2
|
-
import type { TraverseAllows } from "../../shared/traversal.js"
|
|
3
|
-
import { BasePrimitiveConstraint } from "../constraint.js"
|
|
4
|
-
import type { LengthBoundableData } from "./range.js"
|
|
5
|
-
export interface ExactLengthInner extends BaseMeta {
|
|
6
|
-
readonly rule: number
|
|
7
|
-
}
|
|
8
|
-
export type NormalizedExactLengthSchema = ExactLengthInner
|
|
9
|
-
export type ExactLengthSchema = NormalizedExactLengthSchema | number
|
|
10
|
-
export type ExactLengthDeclaration = declareNode<{
|
|
11
|
-
kind: "exactLength"
|
|
12
|
-
schema: ExactLengthSchema
|
|
13
|
-
normalizedSchema: NormalizedExactLengthSchema
|
|
14
|
-
inner: ExactLengthInner
|
|
15
|
-
prerequisite: LengthBoundableData
|
|
16
|
-
errorContext: ExactLengthInner
|
|
17
|
-
}>
|
|
18
|
-
export declare class ExactLengthNode extends BasePrimitiveConstraint<ExactLengthDeclaration> {
|
|
19
|
-
static implementation: import("../../shared/implement.js").nodeImplementationOf<{
|
|
20
|
-
reducibleTo: "exactLength"
|
|
21
|
-
intersectionIsOpen: false
|
|
22
|
-
childKind: never
|
|
23
|
-
kind: "exactLength"
|
|
24
|
-
schema: ExactLengthSchema
|
|
25
|
-
normalizedSchema: ExactLengthInner
|
|
26
|
-
inner: ExactLengthInner
|
|
27
|
-
prerequisite: LengthBoundableData
|
|
28
|
-
errorContext: ExactLengthInner &
|
|
29
|
-
import("../../shared/declare.js").BaseErrorContext<"exactLength">
|
|
30
|
-
}>
|
|
31
|
-
traverseAllows: TraverseAllows<LengthBoundableData>
|
|
32
|
-
readonly compiledCondition: string
|
|
33
|
-
readonly compiledNegation: string
|
|
34
|
-
readonly impliedBasis: import("../../main.js").Type<
|
|
35
|
-
string | unknown[],
|
|
36
|
-
import("../../keywords/internal.js").internalPrimitive.exports
|
|
37
|
-
>
|
|
38
|
-
readonly errorContext: {
|
|
39
|
-
code: "exactLength"
|
|
40
|
-
readonly rule: number
|
|
41
|
-
readonly description?: string
|
|
42
|
-
}
|
|
43
|
-
readonly expression: string
|
|
44
|
-
}
|
|
45
|
-
//# sourceMappingURL=exactLength.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"exactLength.d.ts","sourceRoot":"","sources":["../../../constraints/refinements/exactLength.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAEpE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAC/D,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAA;AAC1D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAA;AAErD,MAAM,WAAW,gBAAiB,SAAQ,QAAQ;IACjD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CACrB;AAED,MAAM,MAAM,2BAA2B,GAAG,gBAAgB,CAAA;AAE1D,MAAM,MAAM,iBAAiB,GAAG,2BAA2B,GAAG,MAAM,CAAA;AAEpE,MAAM,MAAM,sBAAsB,GAAG,WAAW,CAAC;IAChD,IAAI,EAAE,aAAa,CAAA;IACnB,MAAM,EAAE,iBAAiB,CAAA;IACzB,gBAAgB,EAAE,2BAA2B,CAAA;IAC7C,KAAK,EAAE,gBAAgB,CAAA;IACvB,YAAY,EAAE,mBAAmB,CAAA;IACjC,YAAY,EAAE,gBAAgB,CAAA;CAC9B,CAAC,CAAA;AAEF,qBAAa,eAAgB,SAAQ,uBAAuB,CAAC,sBAAsB,CAAC;IACnF,MAAM,CAAC,cAAc;;;;;;;;;;OAwCnB;IAEF,cAAc,EAAE,cAAc,CAAC,mBAAmB,CAAC,CACzB;IAE1B,QAAQ,CAAC,iBAAiB,SAAiC;IAC3D,QAAQ,CAAC,gBAAgB,SAAiC;IAC1D,QAAQ,CAAC,YAAY,mHAAkC;IACvD,QAAQ,CAAC,YAAY;;;;MAAsC;IAC3D,QAAQ,CAAC,UAAU,SAA6B;CAChD"}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { Disjoint } from "../../shared/disjoint.js"
|
|
2
|
-
import { BasePrimitiveConstraint } from "../constraint.js"
|
|
3
|
-
export class ExactLengthNode extends BasePrimitiveConstraint {
|
|
4
|
-
static implementation = this.implement({
|
|
5
|
-
collapsibleKey: "rule",
|
|
6
|
-
keys: {
|
|
7
|
-
rule: {}
|
|
8
|
-
},
|
|
9
|
-
normalize: (schema) =>
|
|
10
|
-
typeof schema === "number" ? { rule: schema } : schema,
|
|
11
|
-
intersections: {
|
|
12
|
-
exactLength: (l, r) =>
|
|
13
|
-
new Disjoint({
|
|
14
|
-
"[length]": {
|
|
15
|
-
unit: {
|
|
16
|
-
l: l.$.node("unit", { unit: l.rule }),
|
|
17
|
-
r: r.$.node("unit", { unit: r.rule })
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
}),
|
|
21
|
-
minLength: (exactLength, minLength) =>
|
|
22
|
-
(
|
|
23
|
-
minLength.exclusive
|
|
24
|
-
? exactLength.rule > minLength.rule
|
|
25
|
-
: exactLength.rule >= minLength.rule
|
|
26
|
-
)
|
|
27
|
-
? exactLength
|
|
28
|
-
: Disjoint.from("range", exactLength, minLength),
|
|
29
|
-
maxLength: (exactLength, maxLength) =>
|
|
30
|
-
(
|
|
31
|
-
maxLength.exclusive
|
|
32
|
-
? exactLength.rule < maxLength.rule
|
|
33
|
-
: exactLength.rule <= maxLength.rule
|
|
34
|
-
)
|
|
35
|
-
? exactLength
|
|
36
|
-
: Disjoint.from("range", exactLength, maxLength)
|
|
37
|
-
},
|
|
38
|
-
hasAssociatedError: true,
|
|
39
|
-
defaults: {
|
|
40
|
-
description(node) {
|
|
41
|
-
return `exactly length ${node.rule}`
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
})
|
|
45
|
-
traverseAllows = (data) => data.length === this.rule
|
|
46
|
-
compiledCondition = `data.length === ${this.rule}`
|
|
47
|
-
compiledNegation = `data.length !== ${this.rule}`
|
|
48
|
-
impliedBasis = this.$.keywords.lengthBoundable
|
|
49
|
-
errorContext = this.createErrorContext(this.inner)
|
|
50
|
-
expression = `{ length: ${this.rule} }`
|
|
51
|
-
}
|
|
52
|
-
//# sourceMappingURL=exactLength.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"exactLength.js","sourceRoot":"","sources":["../../../constraints/refinements/exactLength.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAA;AAEnD,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAA;AAoB1D,MAAM,OAAO,eAAgB,SAAQ,uBAA+C;IACnF,MAAM,CAAC,cAAc,GAAG,IAAI,CAAC,SAAS,CAAC;QACtC,cAAc,EAAE,MAAM;QACtB,IAAI,EAAE;YACL,IAAI,EAAE,EAAE;SACR;QACD,SAAS,EAAE,CAAC,MAAM,EAAE,EAAE,CACrB,OAAO,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,MAAM;QACvD,aAAa,EAAE;YACd,WAAW,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CACrB,IAAI,QAAQ,CAAC;gBACZ,UAAU,EAAE;oBACX,IAAI,EAAE;wBACL,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;wBACrC,CAAC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BAAkB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;IAClD,UAAU,GAAG,aAAa,IAAI,CAAC,IAAI,IAAI,CAAA"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { AfterNode, type AfterDeclaration } from "./after.js"
|
|
2
|
-
import { BeforeNode, type BeforeDeclaration } from "./before.js"
|
|
3
|
-
import { ExactLengthNode, type ExactLengthDeclaration } from "./exactLength.js"
|
|
4
|
-
import { MaxNode, type MaxDeclaration } from "./max.js"
|
|
5
|
-
import { MaxLengthNode, type MaxLengthDeclaration } from "./maxLength.js"
|
|
6
|
-
import { MinNode, type MinDeclaration } from "./min.js"
|
|
7
|
-
import { MinLengthNode, type MinLengthDeclaration } from "./minLength.js"
|
|
8
|
-
export interface BoundDeclarations {
|
|
9
|
-
min: MinDeclaration
|
|
10
|
-
max: MaxDeclaration
|
|
11
|
-
minLength: MinLengthDeclaration
|
|
12
|
-
maxLength: MaxLengthDeclaration
|
|
13
|
-
exactLength: ExactLengthDeclaration
|
|
14
|
-
after: AfterDeclaration
|
|
15
|
-
before: BeforeDeclaration
|
|
16
|
-
}
|
|
17
|
-
export declare const BoundNodes: {
|
|
18
|
-
min: typeof MinNode
|
|
19
|
-
max: typeof MaxNode
|
|
20
|
-
minLength: typeof MinLengthNode
|
|
21
|
-
maxLength: typeof MaxLengthNode
|
|
22
|
-
exactLength: typeof ExactLengthNode
|
|
23
|
-
after: typeof AfterNode
|
|
24
|
-
before: typeof BeforeNode
|
|
25
|
-
}
|
|
26
|
-
export type BoundNodesByKind = {
|
|
27
|
-
[k in keyof typeof BoundNodes]: InstanceType<(typeof BoundNodes)[k]>
|
|
28
|
-
}
|
|
29
|
-
//# sourceMappingURL=kinds.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"kinds.d.ts","sourceRoot":"","sources":["../../../constraints/refinements/kinds.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAC7D,OAAO,EAAE,UAAU,EAAE,KAAK,iBAAiB,EAAE,MAAM,aAAa,CAAA;AAChE,OAAO,EAAE,eAAe,EAAE,KAAK,sBAAsB,EAAE,MAAM,kBAAkB,CAAA;AAC/E,OAAO,EAAE,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,UAAU,CAAA;AACvD,OAAO,EAAE,aAAa,EAAE,KAAK,oBAAoB,EAAE,MAAM,gBAAgB,CAAA;AACzE,OAAO,EAAE,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,UAAU,CAAA;AACvD,OAAO,EAAE,aAAa,EAAE,KAAK,oBAAoB,EAAE,MAAM,gBAAgB,CAAA;AAEzE,MAAM,WAAW,iBAAiB;IACjC,GAAG,EAAE,cAAc,CAAA;IACnB,GAAG,EAAE,cAAc,CAAA;IACnB,SAAS,EAAE,oBAAoB,CAAA;IAC/B,SAAS,EAAE,oBAAoB,CAAA;IAC/B,WAAW,EAAE,sBAAsB,CAAA;IACnC,KAAK,EAAE,gBAAgB,CAAA;IACvB,MAAM,EAAE,iBAAiB,CAAA;CACzB;AAED,eAAO,MAAM,UAAU;;;;;;;;CAQtB,CAAA;AAED,MAAM,MAAM,gBAAgB,GAAG;KAC7B,CAAC,IAAI,MAAM,OAAO,UAAU,GAAG,YAAY,CAAC,CAAC,OAAO,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;CACpE,CAAA"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { AfterNode } from "./after.js"
|
|
2
|
-
import { BeforeNode } from "./before.js"
|
|
3
|
-
import { ExactLengthNode } from "./exactLength.js"
|
|
4
|
-
import { MaxNode } from "./max.js"
|
|
5
|
-
import { MaxLengthNode } from "./maxLength.js"
|
|
6
|
-
import { MinNode } from "./min.js"
|
|
7
|
-
import { MinLengthNode } from "./minLength.js"
|
|
8
|
-
export const BoundNodes = {
|
|
9
|
-
min: MinNode,
|
|
10
|
-
max: MaxNode,
|
|
11
|
-
minLength: MinLengthNode,
|
|
12
|
-
maxLength: MaxLengthNode,
|
|
13
|
-
exactLength: ExactLengthNode,
|
|
14
|
-
after: AfterNode,
|
|
15
|
-
before: BeforeNode
|
|
16
|
-
}
|
|
17
|
-
//# sourceMappingURL=kinds.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"kinds.js","sourceRoot":"","sources":["../../../constraints/refinements/kinds.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAyB,MAAM,YAAY,CAAA;AAC7D,OAAO,EAAE,UAAU,EAA0B,MAAM,aAAa,CAAA;AAChE,OAAO,EAAE,eAAe,EAA+B,MAAM,kBAAkB,CAAA;AAC/E,OAAO,EAAE,OAAO,EAAuB,MAAM,UAAU,CAAA;AACvD,OAAO,EAAE,aAAa,EAA6B,MAAM,gBAAgB,CAAA;AACzE,OAAO,EAAE,OAAO,EAAuB,MAAM,UAAU,CAAA;AACvD,OAAO,EAAE,aAAa,EAA6B,MAAM,gBAAgB,CAAA;AAYzE,MAAM,CAAC,MAAM,UAAU,GAAG;IACzB,GAAG,EAAE,OAAO;IACZ,GAAG,EAAE,OAAO;IACZ,SAAS,EAAE,aAAa;IACxB,SAAS,EAAE,aAAa;IACxB,WAAW,EAAE,eAAe;IAC5B,KAAK,EAAE,SAAS;IAChB,MAAM,EAAE,UAAU;CAClB,CAAA"}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import type { declareNode } from "../../shared/declare.js"
|
|
2
|
-
import {
|
|
3
|
-
BasePrimitiveConstraint,
|
|
4
|
-
type PrimitiveConstraintInner
|
|
5
|
-
} from "../constraint.js"
|
|
6
|
-
import type { LengthBoundableData } from "./range.js"
|
|
7
|
-
export interface LengthInner extends PrimitiveConstraintInner<number> {}
|
|
8
|
-
export type length<n extends number> = {
|
|
9
|
-
"==": n
|
|
10
|
-
}
|
|
11
|
-
export type NormalizedLengthSchema = LengthInner
|
|
12
|
-
export type LengthSchema = NormalizedLengthSchema | number
|
|
13
|
-
export type LengthDeclaration = declareNode<{
|
|
14
|
-
kind: "length"
|
|
15
|
-
schema: LengthSchema
|
|
16
|
-
normalizedSchema: NormalizedLengthSchema
|
|
17
|
-
inner: LengthInner
|
|
18
|
-
prerequisite: LengthBoundableData
|
|
19
|
-
errorContext: LengthInner
|
|
20
|
-
}>
|
|
21
|
-
export declare class LengthNode extends BasePrimitiveConstraint<
|
|
22
|
-
LengthDeclaration,
|
|
23
|
-
typeof LengthNode
|
|
24
|
-
> {
|
|
25
|
-
static implementation: import("../../shared/implement.js").nodeImplementationOf<{
|
|
26
|
-
intersectionIsOpen: false
|
|
27
|
-
childKind: never
|
|
28
|
-
reducibleTo: "length"
|
|
29
|
-
kind: "length"
|
|
30
|
-
schema: LengthSchema
|
|
31
|
-
normalizedSchema: LengthInner
|
|
32
|
-
inner: LengthInner
|
|
33
|
-
prerequisite: LengthBoundableData
|
|
34
|
-
errorContext: LengthInner &
|
|
35
|
-
import("../../shared/declare.js").BaseErrorContext<"length">
|
|
36
|
-
}>
|
|
37
|
-
traverseAllows: (data: LengthBoundableData) => boolean
|
|
38
|
-
readonly compiledCondition: string
|
|
39
|
-
readonly compiledNegation: string
|
|
40
|
-
readonly impliedBasis: import("../../types/union.js").UnionNode<LengthBoundableData>
|
|
41
|
-
readonly errorContext: {
|
|
42
|
-
code: "length"
|
|
43
|
-
description: string
|
|
44
|
-
readonly rule: number
|
|
45
|
-
}
|
|
46
|
-
readonly expression: string
|
|
47
|
-
}
|
|
48
|
-
//# sourceMappingURL=length.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"length.d.ts","sourceRoot":"","sources":["../../../constraints/refinements/length.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAE1D,OAAO,EACN,uBAAuB,EACvB,KAAK,wBAAwB,EAC7B,MAAM,kBAAkB,CAAA;AACzB,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAA;AAErD,MAAM,WAAW,WAAY,SAAQ,wBAAwB,CAAC,MAAM,CAAC;CAAG;AAExE,MAAM,MAAM,MAAM,CAAC,CAAC,SAAS,MAAM,IAAI;IAAE,IAAI,EAAE,CAAC,CAAA;CAAE,CAAA;AAElD,MAAM,MAAM,sBAAsB,GAAG,WAAW,CAAA;AAEhD,MAAM,MAAM,YAAY,GAAG,sBAAsB,GAAG,MAAM,CAAA;AAE1D,MAAM,MAAM,iBAAiB,GAAG,WAAW,CAAC;IAC3C,IAAI,EAAE,QAAQ,CAAA;IACd,MAAM,EAAE,YAAY,CAAA;IACpB,gBAAgB,EAAE,sBAAsB,CAAA;IACxC,KAAK,EAAE,WAAW,CAAA;IAClB,YAAY,EAAE,mBAAmB,CAAA;IACjC,YAAY,EAAE,WAAW,CAAA;CACzB,CAAC,CAAA;AAEF,qBAAa,UAAW,SAAQ,uBAAuB,CACtD,iBAAiB,EACjB,OAAO,UAAU,CACjB;IACA,MAAM,CAAC,cAAc;;;;;;;;;;OAwCnB;IAEF,cAAc,SAAU,mBAAmB,aAA8B;IAEzE,QAAQ,CAAC,iBAAiB,SAAsC;IAChE,QAAQ,CAAC,gBAAgB,SAAsC;IAC/D,QAAQ,CAAC,YAAY,gEAAyB;IAC9C,QAAQ,CAAC,YAAY;;;;MAAsC;IAC3D,QAAQ,CAAC,UAAU,SAA4B;CAC/C"}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { jsData } from "../../shared/compile.js"
|
|
2
|
-
import { Disjoint } from "../../shared/disjoint.js"
|
|
3
|
-
import { BasePrimitiveConstraint } from "../constraint.js"
|
|
4
|
-
export class LengthNode extends BasePrimitiveConstraint {
|
|
5
|
-
static implementation = this.implement({
|
|
6
|
-
collapseKey: "rule",
|
|
7
|
-
keys: {
|
|
8
|
-
rule: {}
|
|
9
|
-
},
|
|
10
|
-
normalize: (schema) =>
|
|
11
|
-
typeof schema === "number" ? { rule: schema } : schema,
|
|
12
|
-
intersections: {
|
|
13
|
-
length: (l, r) =>
|
|
14
|
-
new Disjoint({
|
|
15
|
-
"[length]": {
|
|
16
|
-
unit: {
|
|
17
|
-
l: l.$.parse("unit", { unit: l.rule }),
|
|
18
|
-
r: r.$.parse("unit", { unit: r.rule })
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
}),
|
|
22
|
-
minLength: (length, minLength) =>
|
|
23
|
-
(
|
|
24
|
-
minLength.exclusive
|
|
25
|
-
? length.rule > minLength.rule
|
|
26
|
-
: length.rule >= minLength.rule
|
|
27
|
-
)
|
|
28
|
-
? length
|
|
29
|
-
: Disjoint.from("range", length, minLength),
|
|
30
|
-
maxLength: (length, maxLength) =>
|
|
31
|
-
(
|
|
32
|
-
maxLength.exclusive
|
|
33
|
-
? length.rule < maxLength.rule
|
|
34
|
-
: length.rule <= maxLength.rule
|
|
35
|
-
)
|
|
36
|
-
? length
|
|
37
|
-
: Disjoint.from("range", length, maxLength)
|
|
38
|
-
},
|
|
39
|
-
hasAssociatedError: true,
|
|
40
|
-
defaults: {
|
|
41
|
-
description(node) {
|
|
42
|
-
return `exactly length ${node.rule}`
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
})
|
|
46
|
-
traverseAllows = (data) => data.length === this.rule
|
|
47
|
-
compiledCondition = `${jsData}.length === ${this.rule}`
|
|
48
|
-
compiledNegation = `${jsData}.length !== ${this.rule}`
|
|
49
|
-
impliedBasis = this.$.lengthBoundable
|
|
50
|
-
errorContext = this.createErrorContext(this.inner)
|
|
51
|
-
expression = `{ length: ${this.rule}}`
|
|
52
|
-
}
|
|
53
|
-
//# sourceMappingURL=length.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"length.js","sourceRoot":"","sources":["../../../constraints/refinements/length.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAA;AAEhD,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAA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MAAM,CAAC,IAAI,IAAI,SAAS,CAAC,IAAI,CAChC;gBACA,CAAC,CAAC,MAAM;gBACR,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,CAAC;SAC7C;QACD,kBAAkB,EAAE,IAAI;QACxB,QAAQ,EAAE;YACT,WAAW,CAAC,IAAI;gBACf,OAAO,kBAAkB,IAAI,CAAC,IAAI,EAAE,CAAA;YACrC,CAAC;SACD;KACD,CAAC,CAAA;IAEF,cAAc,GAAG,CAAC,IAAyB,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,KAAK,IAAI,CAAC,IAAI,CAAA;IAEhE,iBAAiB,GAAG,GAAG,MAAM,eAAe,IAAI,CAAC,IAAI,EAAE,CAAA;IACvD,gBAAgB,GAAG,GAAG,MAAM,eAAe,IAAI,CAAC,IAAI,EAAE,CAAA;IACtD,YAAY,GAAG,IAAI,CAAC,CAAC,CAAC,eAAe,CAAA;IACrC,YAAY,GAAG,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;IAClD,UAAU,GAAG,aAAa,IAAI,CAAC,IAAI,GAAG,CAAA"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import type { declareNode } from "../../shared/declare.js"
|
|
2
|
-
import type { nodeImplementationOf } from "../../shared/implement.js"
|
|
3
|
-
import {
|
|
4
|
-
BaseRange,
|
|
5
|
-
type BaseNormalizedRangeSchema,
|
|
6
|
-
type BaseRangeInner
|
|
7
|
-
} from "./range.js"
|
|
8
|
-
export interface MaxInner extends BaseRangeInner {
|
|
9
|
-
rule: number
|
|
10
|
-
}
|
|
11
|
-
export interface NormalizedMaxSchema extends BaseNormalizedRangeSchema {
|
|
12
|
-
rule: number
|
|
13
|
-
}
|
|
14
|
-
export type MaxSchema = NormalizedMaxSchema | number
|
|
15
|
-
export type MaxDeclaration = declareNode<{
|
|
16
|
-
kind: "max"
|
|
17
|
-
schema: MaxSchema
|
|
18
|
-
normalizedSchema: NormalizedMaxSchema
|
|
19
|
-
inner: MaxInner
|
|
20
|
-
prerequisite: number
|
|
21
|
-
errorContext: MaxInner
|
|
22
|
-
}>
|
|
23
|
-
export declare class MaxNode extends BaseRange<MaxDeclaration> {
|
|
24
|
-
static implementation: nodeImplementationOf<MaxDeclaration>
|
|
25
|
-
readonly impliedBasis: import("../../main.js").Type<
|
|
26
|
-
number,
|
|
27
|
-
import("../../keywords/tsPrimitive.js").tsPrimitive.exports
|
|
28
|
-
>
|
|
29
|
-
traverseAllows: (data: number) => boolean
|
|
30
|
-
}
|
|
31
|
-
//# sourceMappingURL=max.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"max.d.ts","sourceRoot":"","sources":["../../../constraints/refinements/max.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAE1D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AACrE,OAAO,EACN,SAAS,EAET,KAAK,yBAAyB,EAC9B,KAAK,cAAc,EACnB,MAAM,YAAY,CAAA;AAEnB,MAAM,WAAW,QAAS,SAAQ,cAAc;IAC/C,IAAI,EAAE,MAAM,CAAA;CACZ;AAED,MAAM,WAAW,mBAAoB,SAAQ,yBAAyB;IACrE,IAAI,EAAE,MAAM,CAAA;CACZ;AAED,MAAM,MAAM,SAAS,GAAG,mBAAmB,GAAG,MAAM,CAAA;AAEpD,MAAM,MAAM,cAAc,GAAG,WAAW,CAAC;IACxC,IAAI,EAAE,KAAK,CAAA;IACX,MAAM,EAAE,SAAS,CAAA;IACjB,gBAAgB,EAAE,mBAAmB,CAAA;IACrC,KAAK,EAAE,QAAQ,CAAA;IACf,YAAY,EAAE,MAAM,CAAA;IACpB,YAAY,EAAE,QAAQ,CAAA;CACtB,CAAC,CAAA;AAEF,qBAAa,OAAQ,SAAQ,SAAS,CAAC,cAAc,CAAC;IACrD,MAAM,CAAC,cAAc,EAAE,oBAAoB,CAAC,cAAc,CAAC,CAuBzD;IAEF,QAAQ,CAAC,YAAY,oGAAyB;IAE9C,cAAc,SACJ,MAAM,aACsB;CACtC"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { Disjoint } from "../../shared/disjoint.js"
|
|
2
|
-
import { BaseRange, parseExclusiveKey } from "./range.js"
|
|
3
|
-
export class MaxNode extends BaseRange {
|
|
4
|
-
static implementation = this.implement({
|
|
5
|
-
collapsibleKey: "rule",
|
|
6
|
-
hasAssociatedError: true,
|
|
7
|
-
keys: {
|
|
8
|
-
rule: {},
|
|
9
|
-
exclusive: parseExclusiveKey
|
|
10
|
-
},
|
|
11
|
-
normalize: (schema) =>
|
|
12
|
-
typeof schema === "number" ? { rule: schema } : schema,
|
|
13
|
-
defaults: {
|
|
14
|
-
description(node) {
|
|
15
|
-
return `${node.exclusive ? "less than" : "at most"} ${
|
|
16
|
-
node.rule
|
|
17
|
-
}`
|
|
18
|
-
}
|
|
19
|
-
},
|
|
20
|
-
intersections: {
|
|
21
|
-
max: (l, r) => (l.isStricterThan(r) ? l : r),
|
|
22
|
-
min: (max, min, $) =>
|
|
23
|
-
max.overlapsRange(min)
|
|
24
|
-
? max.overlapIsUnit(min)
|
|
25
|
-
? $.node("unit", { unit: max.rule })
|
|
26
|
-
: null
|
|
27
|
-
: Disjoint.from("range", max, min)
|
|
28
|
-
}
|
|
29
|
-
})
|
|
30
|
-
impliedBasis = this.$.keywords.number
|
|
31
|
-
traverseAllows = this.exclusive
|
|
32
|
-
? (data) => data < this.rule
|
|
33
|
-
: (data) => data <= this.rule
|
|
34
|
-
}
|
|
35
|
-
//# sourceMappingURL=max.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"max.js","sourceRoot":"","sources":["../../../constraints/refinements/max.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAA;AAEnD,OAAO,EACN,SAAS,EACT,iB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IAAI,CAAC,SAAS;QAC9B,CAAC,CAAC,CAAC,IAAY,EAAE,EAAE,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI;QACpC,CAAC,CAAC,CAAC,IAAY,EAAE,EAAE,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,CAAA"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import type { declareNode } from "../../shared/declare.js"
|
|
2
|
-
import type { nodeImplementationOf } from "../../shared/implement.js"
|
|
3
|
-
import {
|
|
4
|
-
BaseRange,
|
|
5
|
-
type BaseNormalizedRangeSchema,
|
|
6
|
-
type BaseRangeInner,
|
|
7
|
-
type LengthBoundableData
|
|
8
|
-
} from "./range.js"
|
|
9
|
-
export interface MaxLengthInner extends BaseRangeInner {
|
|
10
|
-
rule: number
|
|
11
|
-
}
|
|
12
|
-
export interface NormalizedMaxLengthSchema extends BaseNormalizedRangeSchema {
|
|
13
|
-
rule: number
|
|
14
|
-
}
|
|
15
|
-
export type MaxLengthSchema = NormalizedMaxLengthSchema | number
|
|
16
|
-
export type MaxLengthDeclaration = declareNode<{
|
|
17
|
-
kind: "maxLength"
|
|
18
|
-
schema: MaxLengthSchema
|
|
19
|
-
normalizedSchema: NormalizedMaxLengthSchema
|
|
20
|
-
inner: MaxLengthInner
|
|
21
|
-
prerequisite: LengthBoundableData
|
|
22
|
-
errorContext: MaxLengthInner
|
|
23
|
-
}>
|
|
24
|
-
export declare class MaxLengthNode extends BaseRange<MaxLengthDeclaration> {
|
|
25
|
-
static implementation: nodeImplementationOf<MaxLengthDeclaration>
|
|
26
|
-
readonly impliedBasis: import("../../main.js").Type<
|
|
27
|
-
string | unknown[],
|
|
28
|
-
import("../../keywords/internal.js").internalPrimitive.exports
|
|
29
|
-
>
|
|
30
|
-
traverseAllows: (data: LengthBoundableData) => boolean
|
|
31
|
-
}
|
|
32
|
-
//# sourceMappingURL=maxLength.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"maxLength.d.ts","sourceRoot":"","sources":["../../../constraints/refinements/maxLength.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAE1D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AACrE,OAAO,EACN,SAAS,EAET,KAAK,yBAAyB,EAC9B,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,MAAM,YAAY,CAAA;AAEnB,MAAM,WAAW,cAAe,SAAQ,cAAc;IACrD,IAAI,EAAE,MAAM,CAAA;CACZ;AAED,MAAM,WAAW,yBAA0B,SAAQ,yBAAyB;IAC3E,IAAI,EAAE,MAAM,CAAA;CACZ;AAED,MAAM,MAAM,eAAe,GAAG,yBAAyB,GAAG,MAAM,CAAA;AAEhE,MAAM,MAAM,oBAAoB,GAAG,WAAW,CAAC;IAC9C,IAAI,EAAE,WAAW,CAAA;IACjB,MAAM,EAAE,eAAe,CAAA;IACvB,gBAAgB,EAAE,yBAAyB,CAAA;IAC3C,KAAK,EAAE,cAAc,CAAA;IACrB,YAAY,EAAE,mBAAmB,CAAA;IACjC,YAAY,EAAE,cAAc,CAAA;CAC5B,CAAC,CAAA;AAEF,qBAAa,aAAc,SAAQ,SAAS,CAAC,oBAAoB,CAAC;IACjE,MAAM,CAAC,cAAc,EAAE,oBAAoB,CAAC,oBAAoB,CAAC,CA2B9D;IAEH,QAAQ,CAAC,YAAY,mHAAkC;IAEvD,cAAc,SACJ,mBAAmB,aAC6B;CAC1D"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { Disjoint } from "../../shared/disjoint.js"
|
|
2
|
-
import { BaseRange, parseExclusiveKey } from "./range.js"
|
|
3
|
-
export class MaxLengthNode extends BaseRange {
|
|
4
|
-
static implementation = this.implement({
|
|
5
|
-
collapsibleKey: "rule",
|
|
6
|
-
hasAssociatedError: true,
|
|
7
|
-
keys: {
|
|
8
|
-
rule: {},
|
|
9
|
-
exclusive: parseExclusiveKey
|
|
10
|
-
},
|
|
11
|
-
normalize: (schema) =>
|
|
12
|
-
typeof schema === "number" ? { rule: schema } : schema,
|
|
13
|
-
defaults: {
|
|
14
|
-
description(node) {
|
|
15
|
-
return node.exclusive
|
|
16
|
-
? `less than length ${node.rule}`
|
|
17
|
-
: `at most length ${node.rule}`
|
|
18
|
-
},
|
|
19
|
-
actual: (data) => `${data.length}`
|
|
20
|
-
},
|
|
21
|
-
intersections: {
|
|
22
|
-
maxLength: (l, r) => (l.isStricterThan(r) ? l : r),
|
|
23
|
-
minLength: (max, min, $) =>
|
|
24
|
-
max.overlapsRange(min)
|
|
25
|
-
? max.overlapIsUnit(min)
|
|
26
|
-
? $.node("exactLength", { rule: max.rule })
|
|
27
|
-
: null
|
|
28
|
-
: Disjoint.from("range", max, min)
|
|
29
|
-
}
|
|
30
|
-
})
|
|
31
|
-
impliedBasis = this.$.keywords.lengthBoundable
|
|
32
|
-
traverseAllows = this.exclusive
|
|
33
|
-
? (data) => data.length < this.rule
|
|
34
|
-
: (data) => data.length <= this.rule
|
|
35
|
-
}
|
|
36
|
-
//# sourceMappingURL=maxLength.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"maxLength.js","sourceRoot":"","sources":["../../../constraints/refinements/maxLength.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAA;AAEnD,OAAO,EACN,SAAS,EACT,iBAAiB,EAIjB,MAAM,YAAY,CAAA;AAqBnB,MAAM,OAAO,aAAc,SAAQ,SAA+B;IACjE,MAAM,CAAC,cAAc,GACpB,IAAI,CAAC,SAAS,CAAC;QACd,cAAc,EAAE,MAAM;QACtB,kBAAkB,EAAE,IAAI;QACxB,IAAI,EAAE;YACL,IAAI,EAAE,EAAE;YACR,SAAS,EAAE,iBAAiB;SAC5B;QACD,SAAS,EAAE,CAAC,MAAM,EAAE,EAAE,CACrB,OAAO,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,E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-
import type { declareNode } from "../../shared/declare.js"
|
|
2
|
-
import type { nodeImplementationOf } from "../../shared/implement.js"
|
|
3
|
-
import {
|
|
4
|
-
BaseRange,
|
|
5
|
-
type BaseNormalizedRangeSchema,
|
|
6
|
-
type BaseRangeInner
|
|
7
|
-
} from "./range.js"
|
|
8
|
-
export interface MinInner extends BaseRangeInner {
|
|
9
|
-
rule: number
|
|
10
|
-
}
|
|
11
|
-
export interface NormalizedMinSchema extends BaseNormalizedRangeSchema {
|
|
12
|
-
rule: number
|
|
13
|
-
}
|
|
14
|
-
export type MinSchema = NormalizedMinSchema | number
|
|
15
|
-
export type MinDeclaration = declareNode<{
|
|
16
|
-
kind: "min"
|
|
17
|
-
schema: MinSchema
|
|
18
|
-
normalizedSchema: NormalizedMinSchema
|
|
19
|
-
inner: MinInner
|
|
20
|
-
prerequisite: number
|
|
21
|
-
errorContext: MinInner
|
|
22
|
-
}>
|
|
23
|
-
export declare class MinNode extends BaseRange<MinDeclaration> {
|
|
24
|
-
static implementation: nodeImplementationOf<MinDeclaration>
|
|
25
|
-
readonly impliedBasis: import("../../main.js").Type<
|
|
26
|
-
number,
|
|
27
|
-
import("../../keywords/tsPrimitive.js").tsPrimitive.exports
|
|
28
|
-
>
|
|
29
|
-
traverseAllows: (data: number) => boolean
|
|
30
|
-
}
|
|
31
|
-
//# sourceMappingURL=min.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"min.d.ts","sourceRoot":"","sources":["../../../constraints/refinements/min.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAC1D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AACrE,OAAO,EACN,SAAS,EAET,KAAK,yBAAyB,EAC9B,KAAK,cAAc,EACnB,MAAM,YAAY,CAAA;AAEnB,MAAM,WAAW,QAAS,SAAQ,cAAc;IAC/C,IAAI,EAAE,MAAM,CAAA;CACZ;AAED,MAAM,WAAW,mBAAoB,SAAQ,yBAAyB;IACrE,IAAI,EAAE,MAAM,CAAA;CACZ;AAED,MAAM,MAAM,SAAS,GAAG,mBAAmB,GAAG,MAAM,CAAA;AAEpD,MAAM,MAAM,cAAc,GAAG,WAAW,CAAC;IACxC,IAAI,EAAE,KAAK,CAAA;IACX,MAAM,EAAE,SAAS,CAAA;IACjB,gBAAgB,EAAE,mBAAmB,CAAA;IACrC,KAAK,EAAE,QAAQ,CAAA;IACf,YAAY,EAAE,MAAM,CAAA;IACpB,YAAY,EAAE,QAAQ,CAAA;CACtB,CAAC,CAAA;AAEF,qBAAa,OAAQ,SAAQ,SAAS,CAAC,cAAc,CAAC;IACrD,MAAM,CAAC,cAAc,EAAE,oBAAoB,CAAC,cAAc,CAAC,CAiBzD;IAEF,QAAQ,CAAC,YAAY,oGAAyB;IAE9C,cAAc,SACJ,MAAM,aACsB;CACtC"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { BaseRange, parseExclusiveKey } from "./range.js"
|
|
2
|
-
export class MinNode extends BaseRange {
|
|
3
|
-
static implementation = this.implement({
|
|
4
|
-
collapsibleKey: "rule",
|
|
5
|
-
hasAssociatedError: true,
|
|
6
|
-
keys: {
|
|
7
|
-
rule: {},
|
|
8
|
-
exclusive: parseExclusiveKey
|
|
9
|
-
},
|
|
10
|
-
normalize: (schema) =>
|
|
11
|
-
typeof schema === "number" ? { rule: schema } : schema,
|
|
12
|
-
intersections: {
|
|
13
|
-
min: (l, r) => (l.isStricterThan(r) ? l : r)
|
|
14
|
-
},
|
|
15
|
-
defaults: {
|
|
16
|
-
description(node) {
|
|
17
|
-
return `${node.exclusive ? "more than" : "at least"} ${
|
|
18
|
-
node.rule
|
|
19
|
-
}`
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
})
|
|
23
|
-
impliedBasis = this.$.keywords.number
|
|
24
|
-
traverseAllows = this.exclusive
|
|
25
|
-
? (data) => data > this.rule
|
|
26
|
-
: (data) => data >= this.rule
|
|
27
|
-
}
|
|
28
|
-
//# sourceMappingURL=min.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"min.js","sourceRoot":"","sources":["../../../constraints/refinements/min.ts"],"names":[],"mappings":"AAEA,OAAO,EACN,SAAS,EACT,iBAAiB,EAGjB,MAAM,YAAY,CAAA;AAqBnB,MAAM,OAAO,OAAQ,SAAQ,SAAyB;IACrD,MAAM,CAAC,cAAc,GAAyC,IAAI,CAAC,SAAS,CAAC;QAC5E,cAAc,EAAE,MAAM;QACtB,kBAAkB,EAAE,IAAI;QACxB,IAAI,EAAE;YACL,IAAI,EAAE,EAAE;YACR,SAAS,EAAE,iBAAiB;SAC5B;QACD,SAAS,EAAE,CAAC,MAAM,EAAE,EAAE,CACrB,OAAO,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,MAAM;QACvD,aAAa,EAAE;YACd,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;SAC5C;QACD,QAAQ,EAAE;YACT,WAAW,CAAC,IAAI;gBACf,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,UAAU,IAAI,IAAI,CAAC,IAAI,EAAE,CAAA;YACnE,CAAC;SACD;KACD,CAAC,CAAA;IAEO,YAAY,GAAG,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAA;IAE9C,cAAc,GAAG,IAAI,CAAC,SAAS;QAC9B,CAAC,CAAC,CAAC,IAAY,EAAE,EAAE,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI;QACpC,CAAC,CAAC,CAAC,IAAY,EAAE,EAAE,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,CAAA"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import type { declareNode } from "../../shared/declare.js"
|
|
2
|
-
import type { nodeImplementationOf } from "../../shared/implement.js"
|
|
3
|
-
import {
|
|
4
|
-
BaseRange,
|
|
5
|
-
type BaseNormalizedRangeSchema,
|
|
6
|
-
type BaseRangeInner,
|
|
7
|
-
type LengthBoundableData
|
|
8
|
-
} from "./range.js"
|
|
9
|
-
export interface MinLengthInner extends BaseRangeInner {
|
|
10
|
-
rule: number
|
|
11
|
-
}
|
|
12
|
-
export interface NormalizedMinLengthSchema extends BaseNormalizedRangeSchema {
|
|
13
|
-
rule: number
|
|
14
|
-
}
|
|
15
|
-
export type MinLengthSchema = NormalizedMinLengthSchema | number
|
|
16
|
-
export type MinLengthDeclaration = declareNode<{
|
|
17
|
-
kind: "minLength"
|
|
18
|
-
schema: MinLengthSchema
|
|
19
|
-
normalizedSchema: NormalizedMinLengthSchema
|
|
20
|
-
inner: MinLengthInner
|
|
21
|
-
prerequisite: LengthBoundableData
|
|
22
|
-
errorContext: MinLengthInner
|
|
23
|
-
}>
|
|
24
|
-
export declare class MinLengthNode extends BaseRange<MinLengthDeclaration> {
|
|
25
|
-
static implementation: nodeImplementationOf<MinLengthDeclaration>
|
|
26
|
-
traverseAllows: (data: LengthBoundableData) => boolean
|
|
27
|
-
readonly impliedBasis: import("../../main.js").Type<
|
|
28
|
-
string | unknown[],
|
|
29
|
-
import("../../keywords/internal.js").internalPrimitive.exports
|
|
30
|
-
>
|
|
31
|
-
}
|
|
32
|
-
//# sourceMappingURL=minLength.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"minLength.d.ts","sourceRoot":"","sources":["../../../constraints/refinements/minLength.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAC1D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AACrE,OAAO,EACN,SAAS,EAET,KAAK,yBAAyB,EAC9B,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,MAAM,YAAY,CAAA;AAEnB,MAAM,WAAW,cAAe,SAAQ,cAAc;IACrD,IAAI,EAAE,MAAM,CAAA;CACZ;AAED,MAAM,WAAW,yBAA0B,SAAQ,yBAAyB;IAC3E,IAAI,EAAE,MAAM,CAAA;CACZ;AAED,MAAM,MAAM,eAAe,GAAG,yBAAyB,GAAG,MAAM,CAAA;AAEhE,MAAM,MAAM,oBAAoB,GAAG,WAAW,CAAC;IAC9C,IAAI,EAAE,WAAW,CAAA;IACjB,MAAM,EAAE,eAAe,CAAA;IACvB,gBAAgB,EAAE,yBAAyB,CAAA;IAC3C,KAAK,EAAE,cAAc,CAAA;IACrB,YAAY,EAAE,mBAAmB,CAAA;IACjC,YAAY,EAAE,cAAc,CAAA;CAC5B,CAAC,CAAA;AAEF,qBAAa,aAAc,SAAQ,SAAS,CAAC,oBAAoB,CAAC;IACjE,MAAM,CAAC,cAAc,EAAE,oBAAoB,CAAC,oBAAoB,CAAC,CAyB9D;IAEH,cAAc,SACJ,mBAAmB,aAC6B;IAE1D,QAAQ,CAAC,YAAY,mHAAkC;CACvD"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { BaseRange, parseExclusiveKey } from "./range.js"
|
|
2
|
-
export class MinLengthNode extends BaseRange {
|
|
3
|
-
static implementation = this.implement({
|
|
4
|
-
collapsibleKey: "rule",
|
|
5
|
-
hasAssociatedError: true,
|
|
6
|
-
keys: {
|
|
7
|
-
rule: {},
|
|
8
|
-
exclusive: parseExclusiveKey
|
|
9
|
-
},
|
|
10
|
-
normalize: (schema) =>
|
|
11
|
-
typeof schema === "number" ? { rule: schema } : schema,
|
|
12
|
-
defaults: {
|
|
13
|
-
description(node) {
|
|
14
|
-
return node.exclusive
|
|
15
|
-
? node.rule === 0
|
|
16
|
-
? "non-empty"
|
|
17
|
-
: `more than length ${node.rule}`
|
|
18
|
-
: node.rule === 1
|
|
19
|
-
? "non-empty"
|
|
20
|
-
: `at least length ${node.rule}`
|
|
21
|
-
},
|
|
22
|
-
actual: (data) => `${data.length}`
|
|
23
|
-
},
|
|
24
|
-
intersections: {
|
|
25
|
-
minLength: (l, r) => (l.isStricterThan(r) ? l : r)
|
|
26
|
-
}
|
|
27
|
-
})
|
|
28
|
-
traverseAllows = this.exclusive
|
|
29
|
-
? (data) => data.length > this.rule
|
|
30
|
-
: (data) => data.length >= this.rule
|
|
31
|
-
impliedBasis = this.$.keywords.lengthBoundable
|
|
32
|
-
}
|
|
33
|
-
//# sourceMappingURL=minLength.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"minLength.js","sourceRoot":"","sources":["../../../constraints/refinements/minLength.ts"],"names":[],"mappings":"AAEA,OAAO,EACN,SAAS,EACT,iBAAiB,EAIjB,MAAM,YAAY,CAAA;AAqBnB,MAAM,OAAO,aAAc,SAAQ,SAA+B;IACjE,MAAM,CAAC,cAAc,GACpB,IAAI,CAAC,SAAS,CAAC;QACd,cAAc,EAAE,MAAM;QACtB,kBAAkB,EAAE,IAAI;QACxB,IAAI,EAAE;YACL,IAAI,EAAE,EAAE;YACR,SAAS,EAAE,iBAAiB;SAC5B;QACD,SAAS,EAAE,CAAC,MAAM,EAAE,EAAE,CACrB,OAAO,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,MAAM;QACvD,QAAQ,EAAE;YACT,WAAW,CAAC,IAAI;gBACf,OAAO,IAAI,CAAC,SAAS;oBACpB,CAAC,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC;wBAChB,CAAC,CAAC,WAAW;wBACb,CAAC,CAAC,oBAAoB,IAAI,CAAC,IAAI,EAAE;oBAClC,CAAC,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC;wBACjB,CAAC,CAAC,WAAW;wBACb,CAAC,CAAC,mBAAmB,IAAI,CAAC,IAAI,EAAE,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