Files
Iliyan Angelov 306b20e24a Frontend start
2025-09-14 00:54:48 +03:00

12 lines
292 B
JavaScript

/**
* Pipe
* Compose other transformers to run linearily
* pipe(min(20), max(40))
* @param {...functions} transformers
* @return {function}
*/
const combineFunctions = (a, b) => (v) => b(a(v));
const pipe = (...transformers) => transformers.reduce(combineFunctions);
export { pipe };