Kit
Functions

isNone

isNone<T>(option): option is Readonly<{ __option: "None" }>

Checks whether the given Option contains no value.

This function acts as a type guard, ensuring the value is a None.

Type Parameters

Type ParameterDescription
TThe type of the expected value.

Parameters

ParameterTypeDescription
optionOption<T>The Option to check.

Returns

option is Readonly<{ __option: "None" }>

true if the option is a None, false otherwise.

Example

Checking for None values.

isNone(some(42)); // false
isNone(none());   // true

See

On this page