Video wird geladen...

Video konnte nicht geladen werden

Zur Startseite

I just published TS-Pattern v5! ๐Ÿ™Œ ๐Ÿ‘‰ [_, โ€ฆP.array()] variadic tuple patterns ๐Ÿ‘‰ Builtin predicates for string and number patterns ๐Ÿ‘‰ Chain `.optional`, `.or`, `.and`, and `.select` methods ๐Ÿ‘‰ Improved type narrowing And more! ๐Ÿงต๐Ÿ‘‡

33,319 Aufrufe โ€ข vor 3 Jahren โ€ขvia X (Twitter)

9 Kommentare

Profilbild von Gabriel Vergnaud
Gabriel Vergnaudvor 3 Jahren

Variadic tuple patterns can take as many subpatterns as you want, both on the left side and the right side of ...P.array()! It was really challenging to implement ๐Ÿ˜…

Profilbild von Gabriel Vergnaud
Gabriel Vergnaudvor 3 Jahren

Built-in predicates are super handy when creating zod-like schemas, especially coupled with `isMatching`:

Profilbild von Gabriel Vergnaud
Gabriel Vergnaudvor 3 Jahren

Being able to chain `select` and `optional` modifiers is a very neat DX improvement because you get auto complete suggestions โœจ

Profilbild von Gabriel Vergnaud
Gabriel Vergnaudvor 3 Jahren

Type narrowing is even better! You no longer have to use `as const` anywhere:

Profilbild von Gabriel Vergnaud
Gabriel Vergnaudvor 3 Jahren

If you want to upgrade from TS-Pattern v4, read this guide that goes through all breaking changes and new features:

Profilbild von Gabriel Vergnaud
Gabriel Vergnaudvor 3 Jahren

Hope youโ€™ll enjoy this new version! I started working on it back in January 2022, I'm sooo glad to finally release it ๐Ÿ˜… Find TS-Pattern on GitHub ๐Ÿ‘‡

Profilbild von Luke Czyszczonik
Luke Czyszczonikvor 3 Jahren

I hope to give it a try soon๐Ÿคž

Profilbild von Mark Ledwich
Mark Ledwichvor 3 Jahren

๐Ÿ‘

Profilbild von qingyuano
qingyuanovor 3 Jahren

this library is awesome

ร„hnliche Videos