genType
zod
genType | zod | |
---|---|---|
5 | 335 | |
759 | 34,364 | |
- | - | |
0.0 | 9.0 | |
about 1 year ago | 1 day ago | |
OCaml | TypeScript | |
MIT License | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
genType
-
ts-belt - Fast, modern, and practical utility library for FP in TypeScript / Flow / JavaScript. (Faster than ramda, rambda, remeda and lodash/fp.)
I don't really use ts-belt to be certain, but by looking at the source, it seems that it's using genType, which can generate TS types from ReScript values, and that makes interop work really well.
-
ReScript 10.0
They discuss this in their docs.
https://rescript-lang.org/docs/manual/latest/introduction#di...
Seems like a type system for Javascript, built with a differing set of opinions than Typescript.
Looks like they also offer some form of TS interop:
https://rescript-lang.org/docs/gentype/latest/introduction
- From TypeScript to ReScript
-
TS Belt - fast, modern, and practical utility library for FP in TypeScript
TS Belt has been built with ReScript (and its Belt stdlib). ReScript generates highly performant JavaScript code, and with genType it also automatically generates TypeScript types. Moreover, I've added a few codemods to the building process to provide even more code optimizations and cleaner TypeScript signatures.
-
How I Switched from TypeScript to ReScript
To interoperate with TypeScript with proper type information you’ll use third-party genType. Add it as a devDependency and annotate the module export you want to generate with @genType (in previous versions you’d surround annotations with square brackets).
zod
-
How to validate your Next.js API with Zod and Typescript
Zod is extremely useful and expressive, it allows you to define complex data types and validation rules. You can read the full documentation on GitHub.
-
Building Vhisper: Voice Notes App with AI Transcription and Post-Processing
Zod: For client/server side data validation
-
Learn useActionState quickly with an example (Next.js 15)
useActionState also manages state by automatically updating a state variable with the value returned from the server action. This is particularly helpful for rendering input field validation errors, as shown in the example below using Zod.
- Formulários com React Hook Form + Zod
-
Forget CDK and AWS's insane costs. Pulumi and DigitalOcean to the rescue
Pretty easy to add runtime validation at the edges with Zod https://github.com/colinhacks/zod
Great thing is that the zod schema also doubles as a typescript type so you don't have to write a duplicate TS type.
-
How to build a website using React and Rest APIs (React basics explained)
For user form validation we will install and import Zod. Here declare what format the input needs to be and if there are any requirements like minimum or maximum length.
-
Ink: React for Interactive CLI Apps
Can you name a common language with runtime type safety?
Anyway, you can get this with Zod https://zod.dev/
-
TypeScript's Lack of Naming Types and Type Conversion in Angular
For type conversions, that’s easy: use Zod.
-
AWS CDK context validation
All of this we can achieve by using Zod and a small wrapper.
-
Building Tetris using WebSocket and Svelte Stores
Zod is a TypeScript-first schema validation with static type inference. So let's say for example we have this basic type for a User:
What are some alternatives?
Idris2 - A purely functional programming language with first class types
class-validator - Decorator-based property validation for classes.
melange - A mixture of tooling combined to produce JavaScript from OCaml & Reason
joi - The most powerful data validation library for JS [Moved to: https://github.com/sideway/joi]
from-typescript-to-rescript - Frontend of https://Inhyped.com written in TypeScript and rewritten in ReScript
typebox - Json Schema Type Builder with Static Type Resolution for TypeScript
lwt - OCaml promises and concurrent I/O
Yup - Dead simple Object schema validation
bolt - Bolt is a language with in-built data-race freedom!
ajv - The fastest JSON schema Validator. Supports JSON Schema draft-04/06/07/2019-09/2020-12 and JSON Type Definition (RFC8927)
ts-belt - 🔧 Fast, modern, and practical utility library for FP in TypeScript.
io-ts - Runtime type system for IO decoding/encoding