How gabrieljmj/matchee works
Project type and purpose
• This is an open-source, TypeScript-based NPM library (“matchee”) that provides a type-safe, functional match expression engine (sync and async) and a helper to match object paths.
• There is no frontend or persistent store—this is purely a utility/tool that client code will import and invoke.
File structure
• Top-level files: package.json, README.md, tsconfig.json, CI workflow, lint/prettier configs → build & release setup.
• src/
• index.ts → public API exports (match, asyncMatch, objectPaths, isMatchError, types)
• match.ts → core synchronous matching engine
• comparison-handlers.ts → type-dispatch of expression comparisons (number, string, boolean, RegExp, objectPaths, Symbol)
• object-paths.ts → builds and evaluates nested‐property matchers
• helpers.ts → shared utilities (type guards, path parsing, array/object checks)
• constants.ts → configuration constants (error messages, default case identifier)
• exceptions/ → custom Error classes (UnhandledMatchExpression, InvalidExpressionType)
• tests/ → unit and async tests covering all features and error cases
• .changeset/ → release note mechanism
README for additional insights
• Public API functions: match, asyncMatch, objectPaths, isMatchingError
• Core concepts: passing arrays of cases, default case, lazy evaluation (functions/promises), objectPaths helper, TypeScript generics
• Supported expression types listed; error behavior when no match found