Loading video...
Video Failed to Load
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,311 views โข 3 years ago โขvia X (Twitter)
9 Comments

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 ๐

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

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

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

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

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 ๐

I hope to give it a try soon๐ค

๐

this library is awesome
Related Videos
Sensitive content
Subscribe to my Paid Instagram Private Id ๐ SURJITSAHAOFFICIAL๐ or ๐SurjitSaha๐ for Chats and more ๐
surjit saha
39,945 views โข 2 years ago
Sensitive content
๐ Dive into the world of gaming with RedDeer.Games! Check out latest game videos and don't forget to hit that SUBSCRIBE button for more awesome content! ๐ฎ๐บ ๐ Watch now and subscribe! ๐ Youtube ๐ ๐ #Nintendo #Xbox #PS
RedDeer.Games IR
319,732,940 views โข 2 years ago
