function map
Helps mapping an array inside a pipe
Examples
🔗
▶
Example 1
Example 1
import { pipe, map } from "./composition.ts";
import { assertEquals } from "std/assert/mod.ts";
const result = pipe(
map((val: number) => val * 2),
map((val: number) => val + 1),
)([1, 2, 3]);
assertEquals(result, [3, 5, 7]);