UNPKG

393 BJavaScriptView Raw
1import { IterableX } from './iterablex';
2import { from } from './from';
3export function pipe(source, ...operations) {
4 if (operations.length === 0) {
5 return source instanceof IterableX ? source : from(source);
6 }
7 const piped = (input) => {
8 return operations.reduce((prev, fn) => fn(prev), input);
9 };
10 return piped(source);
11}
12
13//# sourceMappingURL=pipe.mjs.map