百科.dev
全部条目趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
T

ts-pattern

> 编程语言
开源

TypeScript的详尽模式匹配库,带有智能类型的推论.

15.1K stars0 点赞0 次浏览
访问官网GitHub

工具介绍

TypeScript的详尽模式匹配库,带有智能类型的推论.

,与({{}类型:'ok',数据:{{}类型:`text'}}},(res)=,与({{}类型:'ok',数据:{类型:'img',src:P.selection ()}}},(src)==. explect ();关于写作更好、更安全的条件。 父亲..

核心特点

  • •Pattern-match on any data structure: nested Objects, Arrays, Tuples, Sets, Maps and all primitive types.
  • •Typesafe, with helpful type inference.
  • •Exhaustiveness checking support, enforcing that you are matching every possible case with .exhaustive().
  • •Use patterns to validate the shape of your data with isMatching.
  • •Expressive API, with catch-all and type specific wildcards: P._, P.string, P.number, etc.
  • •Supports predicates, unions, intersections and exclusion patterns for non-trivial cases.
  • •Supports properties selection, via the P.select(name?) function.
  • •Tiny bundle footprint (only ~2kB).
  • •Sandbox examples
  • •Getting Started

> 标签

TypeScriptbranchingconditionsexhaustiveinference

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月9日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言
百科.dev

开发者百科,帮助你快速发现语言、框架、数据库、DevOps 与云原生等优质开发者工具。

快捷入口

  • 首页
  • 全部条目
  • 趋势榜
  • 开源项目

关于我们

  • 关于我们
  • 社区公约
  • 技术资讯

参与我们

发现好用的开发者工具?欢迎提交分享。

提交条目
© 2026 开发者百科 baike.dev数据每日更新 · 发现优质开发者工具