devtypes - v1.1.0
    Preparing search index...

    Type Alias NonNullableProps<T, K>

    NonNullableProps: Omit<T, K> & { [P in K]: NonNullable<T[P]> }

    Make specific properties non-nullable.

    Type Parameters

    • T

      Source object type

    • K extends keyof T

      Keys to make non-nullable

    1.1.0

    Removes null and undefined from the selected property value types.

    type User = { id: number | null; name?: string | undefined; email: string | null };
    type NonNullableUser = NonNullableProps< User, 'id' | 'name' >;
    // { id: number; name?: string; email: string | null; }