Checks if a value is an Option.
Option
The expected type of the value contained within the Option.
The value to be checked as an Option.
true if the value is an Option, otherwise false.
true
false
1.2.0
const x = Some(5);console.log(isOption(x)); // trueconsole.log(isOption(null)); // falseconsole.log(isOption({ value: 5 })); // false Copy
const x = Some(5);console.log(isOption(x)); // trueconsole.log(isOption(null)); // falseconsole.log(isOption({ value: 5 })); // false
Checks if a value is an
Option.