ICT30016-Assignment-3/node_modules/motion-utils/dist/es/pipe.mjs
dlawler489 a79a6afd34 intial
intial
2025-09-16 12:09:52 +10:00

11 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 };