Debian Codegraph @

node/rxjs/dist/esm5/internal/util/pipe.js

raw
1 import { identity } from './identity';
2 export function pipe() {
3 var fns = [];
4 for (var _i = 0; _i < arguments.length; _i++) {
5 fns[_i] = arguments[_i];
6 }
7 return pipeFromArray(fns);
8 }
9 export function pipeFromArray(fns) {
10 if (fns.length === 0) {
11 return identity;
12 }
13 if (fns.length === 1) {
14 return fns[0];
15 }
16 return function piped(input) {
17 return fns.reduce(function (prev, fn) { return fn(prev); }, input);
18 };
19 }
20 //# sourceMappingURL=pipe.js.map