Skip to main content

isSomeOption()

isSomeOption<A>(fa): fa is { _tag: "Some"; value: A }

Validates if a value is a valid Option type with Some tag.


Type Parameters​

A: A​

The value type.


Parameters​

fa: #### _tag: "Some" | "None"​

The value to validate.

value?: A​


Returns: fa is { _tag: "Some"; value: A }​

True if the value is a valid Some Option.


Since​

2.0.0


Example​

if (isSomeOption(fa)) {
return E.right(fa.value!);
}
return E.left(onNone());