gvergnaud/ts-pattern

🎨 The exhaustive Pattern Matching library for TypeScript, with smart type inference.

TypeScriptOtherjavascripttypescriptmatchingpatternpattern-matchingbranchinginferencetsconditionstype-inferenceexhaustive
This is stars and forks stats for /gvergnaud/ts-pattern repository. As of 04 May, 2024 this repository has 9391 stars and 88 forks.

TS-Pattern The exhaustive Pattern Matching library for TypeScript with smart type inference. import { match, P } from 'ts-pattern'; type Data = | { type: 'text'; content: string } | { type: 'img'; src: string }; type Result = | { type: 'ok'; data: Data } | { type: 'error'; error: Error }; const result: Result = ...; const html = match(result) .with({ type: 'error' }, () => <p>Oups! An error occured</p>) .with({ type: 'ok', data: { type:...
Read on GithubGithub Stats Page
repotechsstarsweeklyforksweekly
chipsalliance/aib-phy-hardwareVerilogSystemVerilogForth1110270
polymerdao/plonky2-solidity-verifierSolidityRustTypeScript43010
the-pudding/censorshipSvelteJavaScriptCSS44000
yashash1511/win11SvelteSvelteCSSTypeScript1.4k0390
ksz-ksz/rxjs-insightsTypeScriptJavaScriptOther3420130
ichitaro/carla-trailTypeScriptJavaScriptGLSL1100120
DouyinFE/semi-designTypeScriptJavaScriptSCSS7.3k05940
dsrkafuu/sakana-widgetTypeScriptHTMLJavaScript7970500
vinayrayapati/iiitb_rv32iVerilogOther6020
hellotham/hello-astroAstroJavaScriptTypeScript1090380