• Checks whether the optional opt contains x value.

    Type Parameters

    • T

    Parameters

    • x: T

      The value to check.

    Returns ((opt) => boolean)

    Whether x is contained.

    Examples

    import { contains, some, none } from "./option.ts";
    import { assertEquals } from "../deps.ts";

    const hasTwo = contains(2);

    assertEquals(hasTwo(some(2)), true);
    assertEquals(hasTwo(some(3)), false);
    assertEquals(hasTwo(none()), false);
      • (opt): boolean
      • Parameters

        Returns boolean

Generated using TypeDoc