happy-rusty
    Preparing search index...

    Function isOption

    • Checks if a value is an Option.

      Type Parameters

      • T

        The expected type of the value contained within the Option.

      Parameters

      • o: unknown

        The value to be checked as an Option.

      Returns o is Option<T>

      true if the value is an Option, otherwise false.

      1.2.0

      const x = Some(5);
      console.log(isOption(x)); // true
      console.log(isOption(null)); // false
      console.log(isOption({ value: 5 })); // false