Function isNone

  • Type guard to check if an Option is a None value. This function is used to narrow down the type of an Option to NoneOption in TypeScript's type system.

    Type Parameters

    • T extends NonUndefined

    Parameters

    • val: Option<T>

      The Option to be checked.

    Returns val is NoneOption<T>

    true if the provided Option is a NoneOption, false otherwise.

    const option = None;
    if (isNone(option)) {
    console.log('Option does not have a value.');
    }

    Use Option.isNone instead.