Comparing version 2.0.0-rc.25 to 2.0.0-rc.26
import { intrinsic, rootSchema } from "@ark/schema"; | ||
import { wellFormedNumberMatcher } from "@ark/util"; | ||
import { numericStringMatcher } from "@ark/util"; | ||
import { arkModule } from "../utils.js"; | ||
import { regexStringNode } from "./utils.js"; | ||
const root = regexStringNode(wellFormedNumberMatcher, "a well-formed numeric string"); | ||
const root = regexStringNode(numericStringMatcher, "a well-formed numeric string"); | ||
export const numeric = arkModule({ | ||
@@ -7,0 +7,0 @@ root, |
@@ -44,3 +44,3 @@ import { $ark, writeUnboundableMessage } from "@ark/schema"; | ||
} | ||
return (comparator === "==" ? ["minLength", "maxLength"] | ||
return (comparator === "==" ? ["exactLength"] | ||
: comparator[0] === ">" ? ["minLength"] | ||
@@ -79,5 +79,6 @@ : ["maxLength"]); | ||
const exclusive = comparator.length === 1; | ||
// if the comparator is ==, both the min and max of that pair will be applied | ||
for (const kind of getBoundKinds(comparator, typeof limit === "number" ? limit : limitToken, previousRoot, "right")) | ||
s.constrainRoot(kind, { rule: limit, exclusive }); | ||
const boundKinds = getBoundKinds(comparator, typeof limit === "number" ? limit : limitToken, previousRoot, "right"); | ||
for (const kind of boundKinds) { | ||
s.constrainRoot(kind, comparator === "==" ? { rule: limit } : { rule: limit, exclusive }); | ||
} | ||
if (!s.branches.leftBound) | ||
@@ -84,0 +85,0 @@ return; |
{ | ||
"name": "arktype", | ||
"description": "TypeScript's 1:1 validator, optimized from editor to runtime", | ||
"version": "2.0.0-rc.25", | ||
"version": "2.0.0-rc.26", | ||
"license": "MIT", | ||
@@ -37,4 +37,4 @@ "author": { | ||
"dependencies": { | ||
"@ark/util": "0.25.0", | ||
"@ark/schema": "0.25.0" | ||
"@ark/schema": "0.26.0", | ||
"@ark/util": "0.26.0" | ||
}, | ||
@@ -41,0 +41,0 @@ "publishConfig": { |
4703
246064
+ Added@ark/schema@0.26.0(transitive)
+ Added@ark/util@0.26.0(transitive)
- Removed@ark/schema@0.25.0(transitive)
- Removed@ark/util@0.25.0(transitive)
Updated@ark/schema@0.26.0
Updated@ark/util@0.26.0