• Inspects the passing value with an inspector. It is useful for using some side effects.

    Type Parameters

    • T

    Parameters

    • inspector: ((t) => void)

      An inspector to see the passing value.

        • (t): void
        • Parameters

          • t: T

          Returns void

    Returns ((t) => T)

    An identity function.

    Examples

    import { cat, inspect } from "./cat.ts";
    import { assertEquals } from "../deps.ts";

    const result = cat(-3)
    .feed(inspect((x) => assertEquals(x, -3)))
    .feed((x) => x ** 2)
    .feed(inspect((x) => assertEquals(x, 9)))
    .feed((x) => x.toString())
    .feed(inspect((x) => assertEquals(x, "9")));
    assertEquals(result.value, "9");
      • (t): T
      • Parameters

        • t: T

        Returns T

Generated using TypeDoc