Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/optio/operators/query.ts>isSome

Minimum option type port of Rust
Latest
function isSome
import { isSome } from "https://deno.land/x/optio@1.0.0/operators/query.ts";

Returns true if the option is a Some.

Examples

Example 1

import { isSome, Option, Some } from "https://deno.land/x/optio/mod.ts";
import { assert } from "https://deno.land/std/testing/asserts.ts";

const option: Option<number> = Some(2);
assert(isSome(option));

Parameters

option: Readonly<Option<T>>

Returns

option is Some<T>