Comments (2)
Since it's about "validation", I'm also a bit confused by the "parsing" vs "assertion" terminology.
That is about how the API a library provides:
Validation means looking at an object and asserting that it has certain properties:
const unknownData = { /* ... */ }
if (!runtype.test(unknownData)) {
/* deal with the error */
}
/* now work with unknownData being valid */
Parsing is returning a new valid object to work with:
const unknownData = { /* ... */ }
const validData = runtype.parse(unknownData)
/* now work with validData */
Omitting extra keys without mutation an object in-place only works with a parsing API.
In particular, I don't understand the difference between "Strict Parsing" and "Strict Assertion". Isn't it validating the input against a schema and raise an error if it does not strictly match in both cases?
Some libraries only implement parsing or assertion, so I wanted to have separate benchmarks for that.
And to be fast in both cases, libraries that implement both strict modes must add some additional logic to turn the strict parsing case into a strict assertion.
Looking at it now, it seems kind of redundant, but I hope you got my original motivation for it.
from typescript-runtime-type-benchmarks.
Ok, thanks for the detailed explanation.
from typescript-runtime-type-benchmarks.
Related Issues (20)
- feat(package): `parse-dont-validate` HOT 2
- Failing build HOT 1
- How do I add a testcase (Request: Documentation on that) HOT 5
- Add `@Typia` HOT 3
- Suggest: add a table whether each type can be validated or not HOT 3
- Add `caketype`
- Add `@fp-ts/schema`
- Add `@gapstack/light-type` HOT 4
- Add `arktypeio/arktype` HOT 2
- Node 20 HOT 2
- Preview SVG image has been broken HOT 8
- Show operations/s as a number for each benchmark HOT 3
- Show weekly npm downloads for each package HOT 2
- Add `valibot`
- Include failing data in the benchmarks HOT 5
- ParseSafe for Zod calls parse() not safeParse() HOT 1
- Categories for AOT, JIT and Dynamic Validation HOT 5
- Add Effect-TS schema HOT 2
- ahead-of-time clarification HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from typescript-runtime-type-benchmarks.