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 = IsJSONSerializableStrict< { a: string; b: number[] } >; // true
type B = IsJSONSerializableStrict< { a: string; b: undefined } >; // false
type C = IsJSONSerializableStrict< ()=>void >; // false
type D = IsJSONSerializableStrict< ( string | undefined )[] >; // false
type Recurse = { direct: Recurse, union: number | Recurse }
type E = IsJSONSerializableStrict< Recurse >; // false
Type guard: strictly detect whether a type is JSON serializable.