Function hasNoUndefinedProperties

  • Type guard function, checking if any property of the given object is not undefined. Narrows the type of all properties within the object type from T | undefined to just T.

    Example:

    incoming type is { a: number | undefined, b: string | undefined }

    outgoing type is { a: number, b: string }

    Type Parameters

    • T extends object

    Parameters

    • obj: T

      object to check

    Returns obj is {
        [P in string | number | symbol]: NonUndefined<T[P]>
    }

Generated using TypeDoc