devtypes - v2.0.0
    Preparing search index...

    Type Alias JSONSerializableStrict<T>

    JSONSerializableStrict: IsJSONSerializableStrict<T> extends true ? T : never

    Checks whether the type is serializable and returns T, otherwise never.

    Type Parameters

    • T

      Type to test

    Type guard logic is based on IsJSONSerializableStrict.

    type A = JSONSerializableStrict< { a: string; b: number[] } >;   // { a: string; b: number[] }
    type B = JSONSerializableStrict< { a: string; b: undefined } >; // never
    type C = JSONSerializableStrict< ()=>void >; // never
    type D = JSONSerializableStrict< ( string | undefined )[] >; // never