Paths are validated
Every path in a mapping is checked against the input type. A typo like user.emial is a compile error with a "Did you mean 'email'?" suggestion.
Paths & optionality
A declarative mapping language for JSON — validated paths, inferred output types, and compile-time errors instead of production incidents.
Everything below is live: edit the mapping or the input and watch the output, the inferred type, and the diagnostics update on every keystroke. No server — the compiler and the runtime are running in your browser.
{ "id": 42, "fullName": "Ada Lovelace", "isAdmin": true, "email": "unknown", "activeTags": [ "founder" ], "results": [ { "value": 16, "grade": "A" }, { "value": 9, "grade": "C" }, { "value": 12, "grade": "B" } ] }
{
id: number;
fullName: string;
isAdmin: boolean;
email: string;
activeTags: string[];
results: { value: number; grade: "A" | "B" | "C" }[];
}This mapping has two classic bugs: a misspelled property and an unguarded optional access. In a plain function they'd ship as silent undefineds — here they never leave your editor. Fix them live: emial → email, and add ?. + ?? on the second line.
// Fix the mapping errors to see the output.{ mail: any; phone: string }Every diagnostic has a stable code, a hint, and a live reproduction in the diagnostics reference.
Operator pages, the function reference, and the diagnostics reference are generated from the same definitions the compiler executes — signatures, docs and examples can't drift from the implementation. The build fails if an example stops compiling.
| Typeflow | JSONata | jq | Zod | Plain TS function | |
|---|---|---|---|---|---|
| Declarative transformation | ✅ | ✅ | ✅ | ❌ (validation) | ❌ |
| Input paths statically validated | ✅ | ❌ | ❌ | n/a | ✅ |
| Output type inferred | ✅ | ❌ | ❌ | ⚠️ declared | ✅ |
| Serializable / sandboxable artifact | ✅ | ✅ | ✅ | ❌ | ❌ |
| Deterministic by design | ✅ | ⚠️ | ✅ | n/a | ❌ |
Zod is a natural input to Typeflow, not a competitor: Zod answers "is this X?"; Typeflow answers "how does X become Y, and is that conversion sound?"
$ bun add -d typeflowjs
$ bunx typeflow init # scaffold an example mapping
$ bunx typeflow check # tsc-style diagnostics
$ bunx typeflow run user.typeflow --input data.json