3 dépôts
Testing that a subject is iterable with a specific number of items, matching each item against a sub-pattern.
Distinct from Structural Pattern Matching: Distinct from Structural Pattern Matching: focuses specifically on array/iterable length and element matching, not general structural matching.
Explore 3 awesome GitHub repositories matching programming languages & runtimes · Array Structure Matching. Refine with filters or upvote what's useful.
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 comparison
Tests that a subject is iterable with a specific number of items, matching each against sub-patterns.
Sugar est une bibliothèque utilitaire JavaScript conçue pour étendre les objets et prototypes natifs avec des méthodes supplémentaires pour la manipulation et la transformation de données. Elle fonctionne comme une boîte à outils pour les utilitaires d'objets, la manipulation de dates, l'inflexion de chaînes et le polyfilling de fonctionnalités de langage standard manquantes ou défectueuses. La bibliothèque offre la possibilité de mapper des méthodes utilitaires directement sur les prototypes intégrés ou d'envelopper des valeurs dans des objets temporaires pour permettre le chaînage de méthodes sans modifier les prototypes globaux. Elle inclut également un système de polyfill pour garantir un comportement cohérent à travers différents environnements d'exécution en implémentant les fonctionnalités de langage modernes manquantes. Les capacités incluent le formatage international des dates et l'analyse de chaînes de dates humanisées. La bibliothèque gère également le traitement du langage naturel via l'inflexion et la normalisation de chaînes, la traversée profonde des propriétés d'objets imbriqués et le tri de tableaux sensible aux paramètres régionaux. De plus, elle fournit des outils pour cloner des objets mutables et définir des plages de valeurs pour les nombres, les dates et les chaînes.
Simplifies array element matching using strings, regular expressions, or partial object shortcuts.
Z is a pattern matching library for JavaScript that evaluates variables against structural shapes, data types, and literal values to branch program execution conditionally. It functions as a functional programming utility designed to deconstruct arrays and objects into parts during conditional evaluation. The library transforms human-friendly pattern matching syntax into optimized nested conditional statements during compilation or initialization phases, evaluating complex structural conditions and returning matching branch results directly as standard expression values. It inspects runtime d
Evaluate variables against literal values, structural shapes, arrays, types, and class instances to branch program execution.