forked from arktypeio/arktype
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: strict/distilled array traversal, error on double right bound (a…
- Loading branch information
1 parent
6a4f403
commit d927a8e
Showing
6 changed files
with
79 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
"arktype": patch | ||
--- | ||
|
||
## add a syntax error when defining an expression with multiple right bounds | ||
|
||
Ensures expressions like the following result in a syntax error during type validation (will currently not throw at runtime): | ||
|
||
```ts | ||
// Type Error: `Expression 'number' must have at most one right bound` | ||
const boundedNumber = type("number>0<=200") | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
"arktype": patch | ||
--- | ||
|
||
## fix array validation in strict and distilled modes | ||
|
||
Previously, attempting to validate an array with "keys" set to "distilled" or "strict" would yield incorrect results. | ||
|
||
Now, types like this behave as expected: | ||
|
||
```ts | ||
const strictArray = type("string[]", { keys: "strict" }) | ||
// data = ["foo", "bar"] | ||
const { data, problems } = strictArray(["foo", "bar"]) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters