#prog #js #typescript
Banditypes — the mighty 400-byte validator
Check if data conforms to a TS type at runtime — much like zod, yup or superstruct, but in a tiny 400-byte package. Despite the small size, it's not a toy:
Passes the relevant superstruct test suite.
Rich built-in types: maps, sets, tuples, literals, and generic union types.
Mostly API-compatible with the established libraries.
Supports both deriving TS types from schema and declaring a schema for an existing TS type.
User-defined types, refinements, and conversions.
Decent performance — among the top libraries not using code generation.
Banditypes — the mighty 400-byte validator
Check if data conforms to a TS type at runtime — much like zod, yup or superstruct, but in a tiny 400-byte package. Despite the small size, it's not a toy:
Passes the relevant superstruct test suite.
Rich built-in types: maps, sets, tuples, literals, and generic union types.
Mostly API-compatible with the established libraries.
Supports both deriving TS types from schema and declaring a schema for an existing TS type.
User-defined types, refinements, and conversions.
Decent performance — among the top libraries not using code generation.
GitHub
GitHub - thoughtspile/banditypes: 🤠🧨 The mighty 400-byte schema validator for TS / JS
🤠🧨 The mighty 400-byte schema validator for TS / JS - thoughtspile/banditypes
🔥2❤1🌚1
#prog #js #article
Speeding up the JavaScript ecosystem - one library at a time
Серия из десяти (на момент написания) статей о изменениях в библиотеках для JavaScript, которые ускоряют за счёт убирания лишней работы. Некоторые не привязаны конкретно к JavaScript.
Speeding up the JavaScript ecosystem - one library at a time
Серия из десяти (на момент написания) статей о изменениях в библиотеках для JavaScript, которые ускоряют за счёт убирания лишней работы. Некоторые не привязаны конкретно к JavaScript.
marvinh.dev
Speeding up the JavaScript ecosystem - one library at a time
Most popular libraries can be sped up by avoiding unnecessary type conversions or by avoiding creating functions inside functions.
👍6
😁8👎1