Function isNotUndefined

  • Asserts that a value is not undefined.

    Type Parameters

    • T = unknown

    Parameters

    • Optionalval: T

      Value to check

    • OptionalerrorOrMessage: string | Error

      Error object or message to throw if the value is undefined

    Returns asserts val is NonNullable<T>