LendAndRegret/node_modules/es-toolkit/dist/compat/function/flow.mjs
2026-05-02 17:27:43 +08:00

13 lines
359 B
JavaScript

import { flatten } from '../../array/flatten.mjs';
import { flow as flow$1 } from '../../function/flow.mjs';
function flow(...funcs) {
const flattenFuncs = flatten(funcs, 1);
if (flattenFuncs.some(func => typeof func !== 'function')) {
throw new TypeError('Expected a function');
}
return flow$1(...flattenFuncs);
}
export { flow };