@metreeca/core - v0.9.18
    Preparing search index...

    Function isOptional

    • Checks if a value is either undefined or satisfies a type guard.

      Type Parameters

      • T

        The type validated by the type guard

      Parameters

      • value: unknown

        The value to check

      • is: Guard<T>

        A type guard function to validate the value if it is not undefined

      Returns value is T | undefined

      True if the value is undefined or satisfies the type guard; false otherwise