Package: effect
Module: Option
Determines whether the given value is an Option.
When to use
Use to validate unknown values at runtime boundaries, such as type-narrowing in union types.
Details
true for both Some and None instancesOption<unknown>Example (Checking if a value is an Option)
import { Option } from "effect"
console.log(Option.isOption(Option.some(1)))
// Output: true
console.log(Option.isOption(Option.none()))
// Output: true
console.log(Option.isOption({}))
// Output: false
See
isNone to check for None specificallyisSome to check for Some specificallySignature
declare const isOption: (input: unknown) => input is Option<unknown>
Since v2.0.0