finds.dev← search

// the find

anuraghazra/type-trident

★ 357 · TypeScript · updated Jan 2024

A curated list of advanced type level madness

type-trident is a grab-bag of type-level-only TypeScript implementations — bubble sort, tic-tac-toe, a CSS parser, a URL parser, ReactIntl typing, all done purely through conditional and template literal types with zero runtime code. It's for TypeScript developers who want to see how far the type system can be pushed, not something you install and depend on.

Every example ships with a TS Playground link so you can see the actual type inference and errors without cloning the repo. The examples cover genuinely different corners of the type system (recursion, string parsing via template literals, tuple math) instead of one trick copy-pasted ten times. The linked typelevel-parser sister project shows these techniques scale to something non-trivial — a full tokenizer/parser running entirely at compile time.

No tests and no CI — the css-parser folder is labeled 'very buggy' in its own description, and there's no way to know how many of the others are similarly fragile since nothing verifies them beyond 'it compiles.' No explanation of the underlying techniques (how the recursion avoids TS's depth limit, why certain patterns are needed) — you have to reverse-engineer the code or dig up the referenced tweets. No commits since January 2024, so this reads as a finished portfolio piece rather than something being maintained. No license file, which matters if you want to lift any of the code.

View on GitHub →

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →