Skip to main content
Module

x/optionals/mod.ts>None

Rust-like error handling and options for TypeScript and Deno!
Go to Latest
function None
Re-export
import { None } from "https://deno.land/x/optionals@v2.0.0/mod.ts";

Construct the None variant of Option.

Examples

Example 1

 function divide(left: number, right: number): Option<number> {
  if (right === 0) return None();

  return Some(left / right);
}