-
-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: improve arktype discrimination, attest instantiations and compl…
…etions (#1011)
- Loading branch information
1 parent
ee486ef
commit 2be4f5b
Showing
42 changed files
with
734 additions
and
492 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,5 @@ | ||
--- | ||
"@arktype/util": patch | ||
--- | ||
|
||
### Add a new `arrayEquals` util for shallow array comparisons |
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,5 @@ | ||
--- | ||
"@arktype/schema": patch | ||
--- | ||
|
||
### Improve discrimination logic across several issues (see primary release notes at [ArkType's CHANGELOG](../type/CHANGELOG.md)) |
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,71 @@ | ||
--- | ||
"@arktype/attest": minor | ||
--- | ||
|
||
### Throw by default when attest.instantiations() exceeds the specified benchPercentThreshold | ||
|
||
Tests like this will now correctly throw inline instead of return a non-zero exit code: | ||
|
||
```ts | ||
it("can snap instantiations", () => { | ||
type Z = makeComplexType<"asbsdfsaodisfhsda"> | ||
// will throw here as the actual number of instantiations is more | ||
// than 20% higher than the snapshotted value | ||
attest.instantiations([1, "instantiations"]) | ||
}) | ||
``` | ||
|
||
### Snapshotted completions will now be alphabetized | ||
|
||
This will help improve stability, especially for large completion lists like this one which we updated more times than we'd care to admit 😅 | ||
|
||
```ts | ||
attest(() => type([""])).completions({ | ||
"": [ | ||
"...", | ||
"===", | ||
"Array", | ||
"Date", | ||
"Error", | ||
"Function", | ||
"Map", | ||
"Promise", | ||
"Record", | ||
"RegExp", | ||
"Set", | ||
"WeakMap", | ||
"WeakSet", | ||
"alpha", | ||
"alphanumeric", | ||
"any", | ||
"bigint", | ||
"boolean", | ||
"creditCard", | ||
"digits", | ||
"email", | ||
"false", | ||
"format", | ||
"instanceof", | ||
"integer", | ||
"ip", | ||
"keyof", | ||
"lowercase", | ||
"never", | ||
"null", | ||
"number", | ||
"object", | ||
"parse", | ||
"semver", | ||
"string", | ||
"symbol", | ||
"this", | ||
"true", | ||
"undefined", | ||
"unknown", | ||
"uppercase", | ||
"url", | ||
"uuid", | ||
"void" | ||
] | ||
}) | ||
``` |
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
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
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
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
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
Oops, something went wrong.