import { option } from "https://deno.land/x/fun@v.2.0.0-alpha.11/mod.ts";
const { map } = option;
Apply the mapping function fai to the inner value of an Option if it exists. If the option is None then this function does nothing.
Examples
Example 1
Example 1
import * as O from "./option.ts";
import { pipe } from "./fn.ts";
const result1 = pipe(O.some(1), O.map(n => n + 1)); // Some(2)
const result2 = pipe(O.none, O.map((n: number) => n + 1)); // None