isSome
Checks whether the given Option contains a value.
This function acts as a type guard, ensuring the value is a Some.
Type Parameters
| Type Parameter | Description |
|---|---|
T | The type of the contained value. |
Parameters
Returns
option is Readonly<{ __option: "Some"; value: T }>
true if the option is a Some, false otherwise.
Example
Checking for Some values.