Unleash TypeScript's full potential 👉 http://type-level-typescript.com
You can now customize the fallback behavior of `.exhaustive()` if the runtime value you get is unexpected.
upgrade 👉 npm i ts-pattern@5.7.0
You can now customize the fallback behavior of `.exhaustive()` if the runtime value you get is unexpected.
upgrade 👉 npm i ts-pattern@5.7.0
They can easily be transformed with Mapped Types!
Full code snippet in thread 🧵👇
They can easily be transformed with Mapped Types!
Full code snippet in thread 🧵👇
To extract a member of a discriminated union, I find that using the builtin Extract utility is the simplest, but I've noticed that the way Extract works isn't immediately intuitive to most people
To extract a member of a discriminated union, I find that using the builtin Extract utility is the simplest, but I've noticed that the way Extract works isn't immediately intuitive to most people
No need for pesky `Extract`s or `Exclude`s 🔥
No need for pesky `Extract`s or `Exclude`s 🔥
Why are Type Catalogs better?
Find out in the thread 🧵 👇
Why are Type Catalogs better?
Find out in the thread 🧵 👇
👉 Prevent passing impossible patterns to `isMatching` when used with 2 parameters.
👉 `P.infer` behaves better when used in an argument position.
just run `npm i ts-pattern@v5.6.0` in your project 😊
Release note: github.com/gvergnaud/ts...
👉 Prevent passing impossible patterns to `isMatching` when used with 2 parameters.
👉 `P.infer` behaves better when used in an argument position.
just run `npm i ts-pattern@v5.6.0` in your project 😊
Release note: github.com/gvergnaud/ts...
You can get it for 25% off! It's only 74$ to get lifetime access to all course materials.
👉 type-level-typescript.com
Enroll to learn how to craft and transform #TypeScript *types* with the same ease you handle JavaScript values every day!
You can get it for 25% off! It's only 74$ to get lifetime access to all course materials.
👉 type-level-typescript.com
Enroll to learn how to craft and transform #TypeScript *types* with the same ease you handle JavaScript values every day!
If you concat `number` and a union of time units, you have a human readable AND type-safe way to provide time values! 👇
If you concat `number` and a union of time units, you have a human readable AND type-safe way to provide time values! 👇