ts-pattern
ts-essentials
Our great sponsors
ts-pattern | ts-essentials | |
---|---|---|
38 | 4 | |
10,882 | 3,552 | |
- | 1.1% | |
8.5 | 4.6 | |
13 days ago | 10 days ago | |
TypeScript | 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.
ts-pattern
-
You Don't Need React
ts-pattern has been a decent band-aid for the lack of native pattern matching, but obviously has downsides that could be avoided if it was built into the language.
https://github.com/gvergnaud/ts-pattern
- Stop nesting ternaries
-
Building React Components Using Unions in TypeScript
ts-pattern
- Pattern Matching Library for TypeScript
-
TypeScript Is Surprisingly OK for Compilers
With how powerful the type system is you can implement pattern matching via a library pretty convincingly, https://github.com/gvergnaud/ts-pattern is definitely the go-to. That being said pattern matching is hardly a requirement for being ok for implementing compilers.
-
How to achieve type safety here possible without "type hacks"?
https://github.com/gvergnaud/ts-pattern might help
- ts-pattern v5
-
[AskJS] C# in every Node.js job posting?
There's a proposal to add something like that to JavaScript but it's been stuck in limbo since 2017 although there are libraries like ts-pattern which implement it already.
- Simplifying Dynamic Classes in Vue with the class-variance-authority library | cdruc.com
- Rust Appreciation Thread
ts-essentials
-
Essential Code Organization Principles
Also, it’s not as restrictive as mutability tools — if you know what you are doing and want to ignore this limitation for a particular case, you can apply the -readonly modifier or the Writeable type from type-fest or ts-essentials.
- libraries you are happy that you discovered them
-
ts-essentials VS utility-types - a user suggested alternative
2 projects | 24 Nov 2022
-
Explicit empty list type
True a readonly array would help, or even better yet deep readonly (which comes with ts-essentials) when dealing with non-primitive arrays
What are some alternatives?
pattern-grab - 🤛🏻 Regular Expression Data Grabber
ts-toolbelt - 👷 TypeScript's largest type utility library
ts-adt - Generate Algebraic Data Types and pattern matchers
type-fest - A collection of essential TypeScript types
await-to-js - Async await wrapper for easy error handling without try-catch
Superstruct - A simple and composable way to validate data in JavaScript (and TypeScript).
union-types - A Typescript library for creating discriminating union types.
DefinitelyTyped - The repository for high quality TypeScript type definitions. [Moved to: https://github.com/DefinitelyTyped/DefinitelyTyped]
ts-option
talk-typelevel-ts - Code samples for my talk “Type-level programming in TypeScript”
typescript-coverage-report - Node command tool to generate TypeScript coverage report
robot - 🤖 A functional, immutable Finite State Machine library