-
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.
- Loading branch information
Showing
5 changed files
with
26 additions
and
14 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 |
---|---|---|
|
@@ -143,12 +143,13 @@ As a result it has many opinions that might not sit well with some folks. | |
|
||
`Validator` is an obsessed overachiever who wants to be the smallest and fastest one on the track. | ||
|
||
- 39 `Assertion`s | ||
- 808 bytes bundle | ||
- 40 `Assertion`s | ||
- 835 bytes bundle | ||
- ~ 5x faster data validation than `Zod` | ||
- ~ 200x less memory consumption than `Zod` | ||
- ~ 50x faster type-checking than `Zod` | ||
- 0 runtime dependencies | ||
- 1 runtime dependency | ||
- [@the-minimal/error](https://github.com/the-minimal/error) (135 bytes) | ||
- 100% test coverage | ||
|
||
## Simple examples | ||
|
@@ -201,7 +202,7 @@ As a result it has many opinions that might not sit well with some folks. | |
friends: array(string) | ||
}); | ||
|
||
register("Oh not this is gonna throw"); | ||
register("Oh no this is gonna throw"); | ||
|
||
register({ | ||
email: "[email protected]", | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,3 @@ | ||
export const error = (cause: unknown, message = "") => { | ||
throw { | ||
name: "Validation", | ||
message, | ||
cause, | ||
}; | ||
}; | ||
import { error as minimalError } from "@the-minimal/error"; | ||
|
||
export const error = minimalError("Assertion"); |