@yesstudio/nuxt-composables
    Preparing search index...

    Type Alias IsNull<T>

    IsNull: [T] extends [null] ? true : false

    Returns a boolean for whether the given type is null.

    Type Parameters

    • T
    import type {IsNull} from 'type-fest';

    type NonNullFallback<T, Fallback> = IsNull<T> extends true ? Fallback : T;

    type Example1 = NonNullFallback<null, string>;
    //=> string

    type Example2 = NonNullFallback<number, string>;
    //=? number