source: trip-planner-front/node_modules/rxjs/internal/util/pipe.js@ fa375fe

Last change on this file since fa375fe was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 646 bytes
RevLine 
[6a3a178]1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3var identity_1 = require("./identity");
4function pipe() {
5 var fns = [];
6 for (var _i = 0; _i < arguments.length; _i++) {
7 fns[_i] = arguments[_i];
8 }
9 return pipeFromArray(fns);
10}
11exports.pipe = pipe;
12function pipeFromArray(fns) {
13 if (fns.length === 0) {
14 return identity_1.identity;
15 }
16 if (fns.length === 1) {
17 return fns[0];
18 }
19 return function piped(input) {
20 return fns.reduce(function (prev, fn) { return fn(prev); }, input);
21 };
22}
23exports.pipeFromArray = pipeFromArray;
24//# sourceMappingURL=pipe.js.map
Note: See TracBrowser for help on using the repository browser.