UNPKG

itertools-ts

Version:

Extended itertools port for TypeScript and JavaScript. Provides a huge set of functions for working with iterable collections (including async ones)

15 lines 543 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.createPipe = createPipe; function createPipe() { var operations = []; for (var _i = 0; _i < arguments.length; _i++) { operations[_i] = arguments[_i]; } var result = function (input) { return operations.reduce(function (prevResult, operation) { return operation(prevResult); }, input); }; result.add = function (operation) { return createPipe(result, operation); }; return result; } //# sourceMappingURL=pipe.js.map