{"library":"ts-pattern","type":"library","category":null,"description":"TS-Pattern is an exhaustive pattern matching library for TypeScript, providing a typesafe and highly ergonomic API to handle complex conditional logic. It is currently at version 5.9.0 and receives regular updates, often including new pattern types, performance improvements, and type inference enhancements. Key differentiators include its extensive support for various data structures (objects, arrays, tuples, sets, maps, primitives), robust type inference, and crucial exhaustiveness checking, ensuring all possible cases are handled at compile-time. It aims to provide a user-land implementation of pattern matching, similar to those found in functional languages, anticipating a future TC39 proposal, while maintaining a tiny bundle footprint of around 2kB.","language":"javascript","status":"active","version":"5.9.0","tags":["javascript","pattern","matching","pattern-matching","typescript","match-with","match","switch","adt"],"last_verified":"Wed May 27","install":[{"cmd":"npm install ts-pattern","imports":["import { match } from 'ts-pattern';","import { P } from 'ts-pattern';","import { isMatching } from 'ts-pattern';"]},{"cmd":"yarn add ts-pattern","imports":[]},{"cmd":"pnpm add ts-pattern","imports":[]}],"homepage":"https://ts-pattern.com","github":"https://github.com/gvergnaud/ts-pattern","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/ts-pattern","openapi_spec":null,"status_page":null,"smithery":null,"compatibility":{"summary":{"python_range":"18–22","success_rate":0,"avg_install_s":null,"avg_import_s":null,"wheel_type":null},"url":"https://checklist.day/v1/registry/ts-pattern/compatibility"}}