mmkal

mmkal / schematch

Public

pattern matching for typescript 🤝 zod, valibot, arktype

26
1
100% credibility
Found Feb 17, 2026 at 24 stars -- GitGems finds repos before they trend. Get early access to the next one.
Sign Up Free
AI Analysis
TypeScript
AI Summary

schematch provides pattern matching in TypeScript powered by validators from Zod, Valibot, Arktype, and other Standard Schema libraries.

How It Works

1
🔍 Discover schematch

You stumble upon schematch while looking for a smarter way to respond to different kinds of incoming information.

2
📦 Bring it home

You smoothly include schematch in your project with a quick and painless step.

3
đź§© Build decision rules

You create simple rules to recognize text, lists, or structured info and decide what to do with each.

4
⚡ Watch it shine

You try your first example and feel the thrill as it instantly sorts and processes everything perfectly.

5
🔄 Reuse anywhere

You save your smart decision maker and use it repeatedly for fast, reliable handling.

🎉 Effortless control

Your project now gracefully manages any surprise data, staying speedy and organized forever.

Sign up to see the full architecture

4 more

Sign Up Free

Star Growth

See how this repo grew from 24 to 26 stars Sign Up Free
Repurpose This Repo

Repurpose is a Pro feature

Generate ready-to-use prompts for X threads, LinkedIn posts, blog posts, YouTube scripts, and more -- with full repo context baked in.

Unlock Repurpose
AI-Generated Review

What is schematch?

Schematch adds pattern matching to TypeScript using Zod, Valibot, or Arktype schemas as patterns. Write `match(input).case(z.string(), s => s.length).default(() => 'fallback')` for type-safe branching that validates at runtime—no more nested ifs or ts-pattern github syntax. It supports reusable matchers, discriminated unions via `.at('type')`, and mixes libraries like pattern matching rust or pattern matching scala styles in TS.

Why is it gaining traction?

Unlike ts-pattern github or ad-hoc switches, schematch reuses your schemas for both validation and flow control, with arktype often fastest in benches (up to 6x over ts-pattern). Reusable builders cache for hot paths, dispatch tables speed 15-branch discriminators, and matchers double as schemas for composition. Developers love the zero-learning-curve hook: drop-in schema-driven matching without new DSLs.

Who should use this?

TS backend devs handling webhook events or API payloads with Zod unions; frontend folks building reducers or state machines on Valibot schemas; anyone tired of boilerplate for discriminated inputs like github pattern search results or candlestick pattern github parsers.

Verdict

Grab it for schema-heavy pattern matching—perf beats alternatives, docs shine with benches. At 24 stars and 1.0% credibility, it's early (low maturity, thin adoption) but battle-tested via vitest; prototype in non-prod first.

(198 words)

Sign up to read the full AI review Sign Up Free

Similar repos coming soon.