Advanced TypeScript generics, conditional types & soundness

Compile-Time Safety &
Advanced TypeScript Architecture

A technical publication covering type-level programming, template literal types, branded primitives, structural typing, and runtime validation.

Quick Filter:
● deep_readonly.ts
// Advanced recursive mapped type to enforce deep immutability at compile time
type DeepReadonly<T> = T extends Function | Primitive 
    ? T 
    : T extends Map<infer K, infer V> 
    ? ReadonlyMap<DeepReadonly<K>, DeepReadonly<V>>
    : T extends object 
    ? { readonly [K in keyof T]: DeepReadonly<T[K]> } 
    : T;

Type Dispatches

Showing 3 posts
#generics 7 min read

Type-Level Programming: Building Type-Safe State Machines

Using conditional types, infer keywords, and union distributions to enforce valid state transitions at compile time.

OCT 2026 Read Dispatch
#conditional 9 min read

Branded Types & Nominal Typing Patterns in TypeScript

Preventing accidental mixing of primitive IDs, currency amounts, and validated strings using intersection branding techniques.

OCT 2026 Read Dispatch
#soundness 6 min read

Where TypeScript Lacks Soundness: Covariance & Contravariance

Understanding function parameter bivariance, array subtyping pitfalls, and how `strictFunctionTypes` protects your codebase.

SEP 2026 Read Dispatch

Subscribe to Type Safe Journal

Receive weekly TypeScript architecture notes, advanced type-level programming guides, and compile-time tips in your inbox.