@lucid-softworks/pipe
v0.1.0
Published
Type-safe left-to-right function composition.
Maintainers
Readme
@lucid-softworks/pipe
Apply functions from left to right while preserving the type of every step.
import { pipe } from "@lucid-softworks/pipe";
const label = pipe(
2,
(value) => value * 3,
(value) => `Total: ${value}`,
);
// "Total: 6", inferred as stringCalling pipe(value) with no functions returns the original value.
