Type Alias Json<T>

Json<T>: IsAny<T> extends true
    ? EmptyObject
    : unknown extends T
        ? never
        : T extends bigint | symbol | Fun
            ? string
            : T extends {
                    toJSON(): R;
                }
                ? R
                : T extends
                        | boolean
                        | number
                        | string
                        | null
                        | undefined
                    ? T
                    : T extends readonly any[]
                        ? Json<T[number]>[]
                        : {
                            [P in keyof T]: Json<T[P]>
                        }

A representation of the conversion the toJson function will apply to make an input JSON compatible.

Type Parameters

  • T = any