@brizy/ui
Version:
React elements in Brizy style
7 lines (6 loc) • 435 B
JavaScript
import { isT, isTs } from "./fp";
// eslint-disable-next-line @typescript-eslint/no-explicit-any,@typescript-eslint/no-unsafe-function-type
export function mPipe(...[h, ...fns]) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
return (...args) => { var _a; return isTs(args) ? ((_a = fns.reduce((v, fn) => (isT(v) ? fn(v) : undefined), h(...args))) !== null && _a !== void 0 ? _a : undefined) : undefined; };
}