UNPKG

428 BJavaScriptView Raw
1import { AsyncIterableX } from './asynciterablex';
2/* tslint:enable:max-line-length */
3export function pipe(source, ...operations) {
4 if (operations.length === 0) {
5 return source instanceof AsyncIterableX ? source : AsyncIterableX.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