awesome-repositories.com
ब्लॉग
awesome-repositories.com

AI-संचालित खोज के साथ बेहतरीन ओपन-सोर्स रिपॉजिटरी खोजें।

एक्सप्लोर करेंक्यूरेटेड खोजेंओपन-सोर्स विकल्पसेल्फ-होस्टेड सॉफ्टवेयरब्लॉगसाइटमैप
प्रोजेक्टहमारे बारे मेंहम रैंकिंग कैसे करते हैंप्रेसMCP सर्वर
कानूनीगोपनीयताशर्तें
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com
·
tc39 avatar

tc39/proposal-pattern-matching

0
View on GitHub↗
5,782 स्टार्स·90 फोर्क्स·HTML·MIT·2 व्यूज़tc39.es/proposal-pattern-matching↗

Proposal Pattern Matching

This is a TC39 proposal to add declarative pattern matching syntax to the ECMAScript language. It introduces a match expression that allows developers to inspect and branch on data structures using patterns with destructuring, guards, and logical combinators. The proposal defines a custom matcher protocol via a well-known symbol, enabling objects to implement user-defined matching logic with arbitrary extraction and decomposition.

The proposal supports matching against literal primitives using SameValue equality with special handling for signed zero and NaN, as well as relational comparisons and type tests using operators like instanceof. Patterns can be combined with and, or, and not operators that evaluate with short-circuit semantics, and guard clauses can attach arbitrary conditions that must be truthy for an arm to match. Destructuring patterns extract and bind values from arrays and objects using positional, named, rest, and optional syntax, with variable bindings scoped via var, let, or const.

The proposal also covers matching in asynchronous contexts, where arms can use await and the result is wrapped in a Promise. It includes boolean pattern testing via an is operator, regular expression matching with group extraction, and pattern-based exception handling in catch clauses. The specification is available as a staged proposal in the TC39 process.

Features

  • ECMAScript Pattern Matching Proposals - Proposes native ECMAScript pattern matching syntax with destructuring, guards, and logical combinators.
  • Pattern Matching - Introduces a match expression that checks values against structural patterns and returns a boolean result.
  • ECMAScript Pattern Matching Proposals - A TC39 proposal introducing pattern matching with literals, objects, arrays, relational operators, and custom matchers.
  • Data Constructor Decompositions - Tests values against constructors and optionally destructures their internal data in pattern arms.
  • Match Guards - Attaches if conditions to pattern arms that must be truthy for the arm to match, enabling runtime checks.
  • Literal Matching - Compares values to literal numbers, strings, booleans, null, undefined, or symbols using strict equality.
  • Logical Pattern Combinations - Combines multiple patterns with and, or, or not operators to test a subject against all, any, or none of the sub-patterns.
  • Object and Array Destructuring - Extracts values from objects by matching named properties against sub-patterns with optional rest syntax.
  • Pattern Bindings - Binds matched sub-values to variables using var/let/const semantics with rest patterns for arrays and objects.
  • Pattern Destructuring - Extracts and binds values from arrays, objects, and custom extractors using var, let, or const scoping.
  • Match Expression Await Support - Proposes async-aware match expressions with await support inside arms and Promise-wrapped results.
  • Relational Value Comparisons - Matches values against relational operators like less-than, greater-than, equality, and instanceof within patterns.
  • Implicit Subject Comparisons - Employs binary boolean operators in patterns with the subject as the implicit left-hand side.
  • Pattern Relational Comparisons - Allows relational operators and instanceof checks directly in pattern matching arms.
  • Structural Pattern Matching - Extends language grammar with a match expression that destructures values against nested patterns declaratively.
  • ECMAScript Match Expressions - Proposes a match expression for JavaScript with destructuring, guards, and logical combinators.
  • Variable Bindings - Assigns extracted values from matched structures to variables declared within the pattern.
  • Pattern - Binds extracted values from matched structures to variables using var, let, or const within patterns.
  • Pattern Combinator Short-Circuiting - Supports and, or, and not pattern combinators with short-circuit evaluation semantics.
  • Type-Aware Matching - Uses constructor functions or types to test whether a value is an instance of that type in patterns.
  • Protocol-Based - Defines a well-known symbol protocol for user-defined matching logic with arbitrary extraction and decomposition.
  • Pattern Match Combinators - Joins multiple patterns with and, or, or not keywords to require all, any, or none of the sub-patterns to match.
  • Optional Property Matching - Allows object patterns to succeed when specified properties are missing via optional markers.
  • Pattern Guards - Combines pattern matching with conditional guards and logical operators for precise value filtering.
  • Iterable Element Matching - Matches iterable values against nested element patterns with optional variable binding.
  • Regex and Type Guard Matching - Supports regex matching with group extraction and type guard matching against constructors in patterns.
  • Array Element Skipping - Skips leading array elements during pattern matching without binding them.
  • Regular Expression Pattern Implementations - Tests strings against regular expressions and extracts matched groups within pattern arms.
  • Global Regex Matches - Supports global regular expression matching with group extraction in pattern arms.
  • Algebraic Data Types - Matches values against constructors and destructures their internal data in a functional programming style.
  • Unary Sign Matching - Matches numeric values against unary plus or minus expressions with SameValue zero handling.
  • Property Pattern Matching - Matches object properties against nested patterns with optional value binding.
  • Async - Supports pattern matching in async contexts with await inside arms and Promise-wrapped results.
  • Extractor Patterns - Combines custom matchers with array-like patterns on return values for structured decomposition of matched results.
  • Pattern-Based Exception Handling - Uses pattern matching in catch clauses to conditionally handle exceptions based on type or value.
  • Array Structure Matching - Tests that a subject is iterable with a specific number of items, matching each against sub-patterns.
  • Iterable Structure Matching - Matches iterable structures by length, element sub-patterns, and optional rest collection.
  • Object Structure Matching - Matches object structures by property presence, sub-patterns, and rest collection.
  • When Expression Pattern Matching - Evaluates a value against pattern clauses and returns the result of the first matching clause.
  • Pattern Variable References - Resolves variable or property paths and tests the subject for SameValue equality with the resolved value.
  • Built-in Type Guards - Provides built-in custom matchers for JavaScript primitive types and constructors in pattern matching.
  • Remaining Element Retrieval - Captures remaining elements of arrays or properties of objects into a single variable during destructuring.
  • SameValue Equality with Signed Zero - Uses SameValue equality for literal primitives with special handling for signed zero and NaN.
  • Pattern Matching Boolean Tests - Uses the is operator to check a value against a pattern, returning true or false with optional bindings.

स्टार हिस्ट्री

tc39/proposal-pattern-matching के लिए स्टार हिस्ट्री चार्टtc39/proposal-pattern-matching के लिए स्टार हिस्ट्री चार्ट

AI सर्च

और अधिक बेहतरीन रिपॉजिटरी खोजें

अपनी ज़रूरत को सरल भाषा में बताएं — AI हजारों क्यूरेटेड ओपन-सोर्स प्रोजेक्ट्स को प्रासंगिकता के आधार पर रैंक करता है।

Start searching with AI

अक्सर पूछे जाने वाले प्रश्न

tc39/proposal-pattern-matching क्या करता है?

This is a TC39 proposal to add declarative pattern matching syntax to the ECMAScript language. It introduces a match expression that allows developers to inspect and branch on data structures using patterns with destructuring, guards, and logical combinators. The proposal defines a custom matcher protocol via a well-known symbol, enabling objects to implement user-defined matching logic with arbitrary extraction and decomposition.

tc39/proposal-pattern-matching की मुख्य विशेषताएं क्या हैं?

tc39/proposal-pattern-matching की मुख्य विशेषताएं हैं: ECMAScript Pattern Matching Proposals, Pattern Matching, Data Constructor Decompositions, Match Guards, Literal Matching, Logical Pattern Combinations, Object and Array Destructuring, Pattern Bindings।

tc39/proposal-pattern-matching के कुछ ओपन-सोर्स विकल्प क्या हैं?

tc39/proposal-pattern-matching के ओपन-सोर्स विकल्पों में शामिल हैं: reasonml/reason — Reason is a strongly typed functional language and multi-target compiler designed to produce either JavaScript for web… unisonweb/unison. rust-lang/book — The Rust Programming Language Book is the official technical guide and educational resource for the Rust language. It… purescript/purescript — PureScript is a statically typed, purely functional programming language that compiles to JavaScript. It is designed… openrewrite/rewrite — OpenRewrite is an automated refactoring engine and source-to-source migration framework. It uses a lossless semantic… evhub/coconut — Coconut is a functional programming language that compiles to Python. It functions as a source-to-source compiler,…

Proposal Pattern Matching के ओपन-सोर्स विकल्प

समान ओपन-सोर्स प्रोजेक्ट्स, जो Proposal Pattern Matching के साथ साझा की गई सुविधाओं के आधार पर रैंक किए गए हैं।
  • reasonml/reasonreasonml का अवतार

    reasonml/reason

    10,313GitHub पर देखें↗

    Reason is a strongly typed functional language and multi-target compiler designed to produce either JavaScript for web environments or native machine code for operating systems. It serves as an OCaml-compatible language that shares an abstract syntax tree with OCaml, providing a practical syntax for the OCaml ecosystem. The project functions as a type-safe frontend language, incorporating JSX support to build user interfaces through structural elements that translate into type-safe function calls. It enables deep integration with the JavaScript ecosystem, allowing the use of existing librarie

    OCamljavascriptocamlprogramming-language
    GitHub पर देखें↗10,313
  • unisonweb/unisonunisonweb का अवतार

    unisonweb/unison

    6,487GitHub पर देखें↗
    Haskellhacktoberfesthaskellprogramming-language
    GitHub पर देखें↗6,487
  • rust-lang/bookrust-lang का अवतार

    rust-lang/book

    17,930GitHub पर देखें↗

    The Rust Programming Language Book is the official technical guide and educational resource for the Rust language. It provides a comprehensive walkthrough of the language's design, focusing on its core identity as a systems programming language that enforces memory safety and high-performance execution without the need for a garbage collector. The project is distinguished by its focus on ownership, borrowing, and lifetime tracking, which allow the compiler to verify memory safety and thread safety at compile time. It covers the language's unique approach to zero-cost abstractions, including t

    Rustbookmdbookrust
    GitHub पर देखें↗17,930
  • purescript/purescriptpurescript का अवतार

    purescript/purescript

    8,832GitHub पर देखें↗

    PureScript is a statically typed, purely functional programming language that compiles to JavaScript. It is designed as a cross-platform frontend language for building safe web applications, utilizing a static type system and a JavaScript compiler to ensure program correctness across browser and server environments. The language is distinguished by its emphasis on mathematical purity, featuring a robust type system with first-class support for monads. It provides a sophisticated toolset for static verification, including algebraic data types, type classes, and automatic type inference to reje

    Haskellalt-jshaskelljavascript
    GitHub पर देखें↗8,832
Proposal Pattern Matching के सभी 30 विकल्प देखें→