awesome-repositories.com
博客
MCP
awesome-repositories.com

通过 AI 驱动的搜索,发现最优秀的开源仓库。

探索精选搜索开源替代品自托管软件博客网站地图
项目MCP 服务器关于排名机制媒体报道
法律隐私政策服务条款
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com
·
gvergnaud avatar

gvergnaud/ts-pattern

0
View on GitHub↗
15,034 星标·168 分支·TypeScript·MIT·16 次浏览

Ts Pattern

This library provides a declarative approach to conditional logic in TypeScript, replacing imperative branching with structural pattern matching. It functions as a tool for decomposing complex data structures and mapping them to specific execution branches, ensuring that all possible states are accounted for during development.

The library distinguishes itself by enforcing exhaustive logic, which requires developers to address every possible branch of a data structure to prevent runtime errors. By leveraging compile-time type narrowing and recursive evaluation, it allows for the validation and transformation of deeply nested objects while maintaining strict type safety throughout the control flow.

Beyond its core matching capabilities, the library supports complex data validation and functional state transformation. It provides a framework for evaluating incoming data against defined structural requirements, ensuring that variations in input are processed in a predictable and type-safe manner.

Features

  • Pattern Matching - Provides a type-safe utility for exhaustive pattern matching and data structure decomposition in TypeScript.
  • Pattern Matching Libraries - Maps input data to specific execution branches using a declarative syntax that replaces traditional imperative conditional logic blocks.
  • Type Narrowing - Refines variable types within conditional branches based on structural pattern matching.
  • Exhaustiveness Checkers - Require every possible branch of a data structure to be addressed during development to prevent unexpected runtime errors when processing incomplete or missing state information.
  • Functional Utility Libraries - Exhaustive pattern matching library for TypeScript.
  • Type-Level Conditional Logic - Implements robust branching logic that guarantees type safety and exhaustive coverage at compile time.
  • Data Validation - Enforces structural rules and type requirements on incoming data to ensure safe processing.
  • Structural Data Validators - Evaluate incoming data against specific structural requirements and execute the corresponding logic to ensure every variation of the input is processed safely and predictably throughout the application.
  • Recursive Validation Engines - Handles nested data structures by dynamically dispatching validation logic across type hierarchies.
  • Type-Safe Data Handling - Ensures all possible data states are covered at compile time through type-safe control flow mechanisms.
  • Functional State Management - Processes complex nested objects by mapping patterns to functional logic for reliable state transformation.

Star 历史

gvergnaud/ts-pattern 的 Star 历史图表gvergnaud/ts-pattern 的 Star 历史图表

AI 搜索

探索更多 awesome 仓库

用简单的语言描述您的需求 —— AI 将根据相关性为您从数千个精选开源项目中进行排序。

Start searching with AI

Ts Pattern 的开源替代方案

相似的开源项目,按与 Ts Pattern 的功能重合度排序。
  • crystal-lang/crystalcrystal-lang 的头像

    crystal-lang/crystal

    20,299在 GitHub 上查看↗

    Crystal is a statically typed, compiled programming language designed for high performance and memory safety. It leverages an LLVM-based compiler to translate source code into optimized machine-executable binaries, while its type-inference-based static analysis enforces strict safety rules during the build process. The language distinguishes itself through a fiber-based concurrent runtime that manages lightweight execution units for asynchronous input and output without blocking the main process. It also features a powerful compile-time macro system that allows for the inspection and transfor

    Crystalcompilercrystalcrystal-language
    在 GitHub 上查看↗20,299
  • python/mypypython 的头像

    python/mypy

    20,489在 GitHub 上查看↗

    mypy is a static type checker for Python that analyzes source code to detect type errors and inconsistencies without executing the program. It functions as a static analysis tool and type inference engine, providing a gradual typing system that allows type hints to be added to a codebase incrementally while maintaining compatibility with dynamic typing. The project distinguishes itself through a combination of performance and precision features. It utilizes a daemon-based incremental checking system and multi-process parallel analysis to manage large codebases, supported by binary cache persi

    Pythonlinterpythontypechecker
    在 GitHub 上查看↗20,489
  • elm/compilerelm 的头像

    elm/compiler

    7,794在 GitHub 上查看↗

    This project is a functional programming compiler and JavaScript transpiler that transforms a statically typed language into optimized JavaScript for web browsers. It serves as a frontend architecture framework, providing a static type system and a package manager that enforces semantic versioning. The compiler uses a type-checking engine with automatic type inference to prevent runtime errors and guide code refactoring. It implements a structural pattern for managing application state and rendering user interfaces through a virtual DOM, utilizing immutable data and purity-based state transit

    Haskellcompilerelm
    在 GitHub 上查看↗7,794
  • evhub/coconutevhub 的头像

    evhub/coconut

    4,338在 GitHub 上查看↗

    Coconut is a functional programming language that compiles to Python. It functions as a source-to-source compiler, translating high-level functional syntax into compatible Python code to maintain runtime compatibility. The language introduces a logic system for pattern matching and destructuring complex data structures. It provides a mechanism for tail call optimization to prevent stack overflow errors during deep recursive function calls and employs a lazy evaluation engine to defer computations until results are explicitly required. The project includes support for algebraic data types, pi

    Python
    在 GitHub 上查看↗4,338
查看 Ts Pattern 的所有 30 个替代方案→

常见问题解答

gvergnaud/ts-pattern 是做什么的?

This library provides a declarative approach to conditional logic in TypeScript, replacing imperative branching with structural pattern matching. It functions as a tool for decomposing complex data structures and mapping them to specific execution branches, ensuring that all possible states are accounted for during development.

gvergnaud/ts-pattern 的主要功能有哪些?

gvergnaud/ts-pattern 的主要功能包括:Pattern Matching, Pattern Matching Libraries, Type Narrowing, Exhaustiveness Checkers, Functional Utility Libraries, Type-Level Conditional Logic, Data Validation, Structural Data Validators。

gvergnaud/ts-pattern 有哪些开源替代品?

gvergnaud/ts-pattern 的开源替代品包括: crystal-lang/crystal — Crystal is a statically typed, compiled programming language designed for high performance and memory safety. It… python/mypy — mypy is a static type checker for Python that analyzes source code to detect type errors and inconsistencies without… evhub/coconut — Coconut is a functional programming language that compiles to Python. It functions as a source-to-source compiler,… elm/compiler — This project is a functional programming compiler and JavaScript transpiler that transforms a statically typed… go-ozzo/ozzo-validation — ozzo-validation is a programmable data validation library for Go that verifies structs, maps, and primitive types… ianstormtaylor/superstruct — Superstruct is a JavaScript and TypeScript data validation library used to verify that data structures match defined…