Function applyOrMap

  • Computation streamliner involving unions of the form A | A[] and functions of the form f: A -> B. It applies f to inputs of type A and maps f over A[] otherwise.

    Type Parameters

    • A
    • B

    Parameters

    • f: ((a) => B)

      function to apply to input

        • (a): B
        • Parameters

          Returns B

    • input: A | A[]

      input argument

    Returns B | B[]

    result of appropriate application of function to input

Generated using TypeDoc