Type to test
Recursively inspects the structure of T to ensure all components
are fully compatible with JSON serialization rules.
Strict check: functions and undefined are considered non-serializable.
Will refuse any recursive type to ensure no cyclic references in objects.
type A = IsJSONSerializable< { a: string; b: number[] } >; // true
type B = IsJSONSerializable< { a: string; b: undefined } >; // false
type C = IsJSONSerializable< ()=>void >; // false
type D = IsJSONSerializable< ( string | undefined )[] >; // false
type Recurse = { direct: Recurse, union: number | Recurse }
type E = IsJSONSerializable< Recurse >; // false
Type guard: strictly detect whether a type is JSON serializable.