UNPKG

@brizy/ui

Version:
10 lines (9 loc) 544 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.mPipe = mPipe; const fp_1 = require("./fp"); // eslint-disable-next-line @typescript-eslint/no-explicit-any,@typescript-eslint/no-unsafe-function-type function mPipe(...[h, ...fns]) { // eslint-disable-next-line @typescript-eslint/no-explicit-any return (...args) => { var _a; return (0, fp_1.isTs)(args) ? ((_a = fns.reduce((v, fn) => ((0, fp_1.isT)(v) ? fn(v) : undefined), h(...args))) !== null && _a !== void 0 ? _a : undefined) : undefined; }; }