import { filter } from "https://deno.land/x/ahh@v0.12.4/src/option.ts";
Returns option
if fn
returns true
and it is a
Some
.
Examples
Example 1
Example 1
import { default as O, Option } from "./option.ts";
const num: Option<number> = 8;
const even = O.filter(num, (i) => i % 2 === 0);
console.log(even ?? "num is odd");