Skip to main content

JsonCompatible

A type representing JSON-compatible values. From https://github.com/microsoft/TypeScript/issues/1897#issuecomment-580962081

Signature
type JsonCompatible<T> = {    [P in keyof T]: T[P] extends Json        ? T[P]        : Pick<T, P> extends Required<Pick<T, P>>          ? never          : JsonCompatible<T[P]>;}
Was this chapter helpful?
Report Issue
Edited Feb 4, 2026·Edit this page