UNPKG

es-toolkit

Version:

A state-of-the-art, high-performance JavaScript utility library with a small bundle size and strong type annotations.

12 lines (10 loc) 291 B
function flow(...funcs) { return function (...args) { let result = funcs.length ? funcs[0].apply(this, args) : args[0]; for (let i = 1; i < funcs.length; i++) { result = funcs[i].call(this, result); } return result; }; } export { flow };