TypeScript `ReadonlyDeep` Without a Library: Writing the Recursive Utility Type Once and Never Again A developer has published a self-contained TypeScript utility type, ReadonlyDeep, that recursively applies readonly modifiers to every property at every nesting depth, closing the gap left by the built-in Readonly, which only protects top-level properties. The implementation branches on primitives, functions, arrays (via infer and ReadonlyArray), and objects, using a mapped type that recurses into each key. The writeup notes the basic version breaks down for Map and Set, which require ReadonlyMap and ReadonlySet, and demonstrates compile-time errors on nested mutations without any runtime checks or library dependency. ReadonlyDeep