Sonar helps you commit clean code every time. With over 300 unique rules to find JavaScript bugs, code smells & vulnerabilities, Sonar finds the issues while you focus on the work. Learn more →
Ts-pattern Alternatives
Similar projects and alternatives to ts-pattern
-
-
-
Appwrite
Appwrite - The Open Source Firebase alternative introduces iOS support . Appwrite is an open source backend server that helps you build native iOS applications much faster with realtime APIs for authentication, databases, files storage, cloud functions and much more!
-
-
-
proposal-pattern-matching
Pattern matching syntax for ECMAScript
-
typescript-coverage-report
Node command tool to generate TypeScript coverage report
-
InfluxDB
Access the most powerful time series database as a service. Ingest, store, & analyze all types of time series data in a fully-managed, purpose-built database. Keep data forever with low-cost storage and superior data compression.
-
-
-
-
-
-
-
TypeScript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
asdf
Extendable version manager with support for Ruby, Node.js, Elixir, Erlang & more
-
-
-
-
-
-
Sonar
Write Clean JavaScript Code. Always.. Sonar helps you commit clean code every time. With over 300 unique rules to find JavaScript bugs, code smells & vulnerabilities, Sonar finds the issues while you focus on the work.
ts-pattern reviews and mentions
-
Safer exhaustive switch statements in TypeScript
Here is a library providing the described logic with a nice interface. I've used it before and others seems to find it helpful too.
-
libraries you are happy that you discovered them
I've use used ts-pattern before to simplify some complex if/elses
ts-pattern: https://github.com/gvergnaud/ts-pattern (pattern matching)
-
Write fewer tests by creating better TypeScript types
Switch statements are extremely limited and suffer from a fall-through hazard that can lead to errors and bad practices. Thankfully, several npm packages can help with type-narrowing discriminated unions, and the ts-pattern library is an excellent choice.
-
Next.js template
ts-pattern, type refinement, more state, etc. __tag is better than isXxx.
-
Stop requiring only one assertion per unit test: Multiple assertions are fine
I'm not aware of any related to testing, but perhaps you could use something like this in tandem with some tests to pull it off?
-
Ensure you never forget a case in a switch
Or use ts-patten it's comming to Deno soon (thanks to Denoify).
-
WASM is the future?
or just use Typescript. It already supports algebraic data types and typescript has an exhaustive pattern-matching library as well https://github.com/gvergnaud/ts-pattern. Most people whining about more wasm usually aren't experienced web developers, so they don't know that a lot of the stuff they want already exists in Typescript or modern Javascript.
-
What are your favorite small utility packages?
ts-pattern - exhaustive pattern matching is very useful. Especially with react-query on the various states of the response. The inference is great as well.
-
Type-safe event handling in Typescript with zod and ts-match
In many functional languages, we have support for pattern-matching with built in support for exhaustiveness check. Typescript does not have this at the moment but there are userland implementations that emulate pattern matching. One such library is ts-pattern, which I have found to work very well in practice.
-
A note from our sponsor - Sonar
www.sonarsource.com | 24 Mar 2023
Stats
gvergnaud/ts-pattern is an open source project licensed under MIT License which is an OSI approved license.