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());