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)

188 lines 7.43 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.LengthError = exports.InvalidArgumentError = exports.createPipe = exports.AsyncStream = exports.Stream = exports.transform = exports.summary = exports.reduce = exports.combinatorics = exports.set = exports.multi = exports.math = exports.infinite = exports.single = void 0; var single_1 = require("./single"); var infinite_1 = require("./infinite"); var math_1 = require("./math"); var multi_1 = require("./multi"); var set_1 = require("./set"); var combinatorics_1 = require("./combinatorics"); var reduce_1 = require("./reduce"); var stream_1 = require("./stream"); Object.defineProperty(exports, "Stream", { enumerable: true, get: function () { return stream_1.Stream; } }); var async_stream_1 = require("./async-stream"); Object.defineProperty(exports, "AsyncStream", { enumerable: true, get: function () { return async_stream_1.AsyncStream; } }); var summary_1 = require("./summary"); var transform_1 = require("./transform"); var pipe_1 = require("./pipe"); Object.defineProperty(exports, "createPipe", { enumerable: true, get: function () { return pipe_1.createPipe; } }); var exceptions_1 = require("./exceptions"); Object.defineProperty(exports, "InvalidArgumentError", { enumerable: true, get: function () { return exceptions_1.InvalidArgumentError; } }); Object.defineProperty(exports, "LengthError", { enumerable: true, get: function () { return exceptions_1.LengthError; } }); exports.single = { chunkwise: single_1.chunkwise, chunkwiseOverlap: single_1.chunkwiseOverlap, compress: single_1.compress, dropWhile: single_1.dropWhile, enumerate: single_1.enumerate, filter: single_1.filter, flatMap: single_1.flatMap, flatten: single_1.flatten, groupBy: single_1.groupBy, keys: single_1.keys, limit: single_1.limit, map: single_1.map, pairwise: single_1.pairwise, repeat: single_1.repeat, skip: single_1.skip, slice: single_1.slice, sort: single_1.sort, takeWhile: single_1.takeWhile, values: single_1.values, chunkwiseAsync: single_1.chunkwiseAsync, chunkwiseOverlapAsync: single_1.chunkwiseOverlapAsync, compressAsync: single_1.compressAsync, dropWhileAsync: single_1.dropWhileAsync, enumerateAsync: single_1.enumerateAsync, filterAsync: single_1.filterAsync, flatMapAsync: single_1.flatMapAsync, flattenAsync: single_1.flattenAsync, groupByAsync: single_1.groupByAsync, keysAsync: single_1.keysAsync, limitAsync: single_1.limitAsync, mapAsync: single_1.mapAsync, pairwiseAsync: single_1.pairwiseAsync, repeatAsync: single_1.repeatAsync, skipAsync: single_1.skipAsync, sliceAsync: single_1.sliceAsync, sortAsync: single_1.sortAsync, takeWhileAsync: single_1.takeWhileAsync, valuesAsync: single_1.valuesAsync, }; exports.infinite = { count: infinite_1.count, cycle: infinite_1.cycle, cycleAsync: infinite_1.cycleAsync, repeat: infinite_1.repeat, }; exports.math = { runningAverage: math_1.runningAverage, runningDifference: math_1.runningDifference, runningMax: math_1.runningMax, runningMin: math_1.runningMin, runningProduct: math_1.runningProduct, runningTotal: math_1.runningTotal, runningAverageAsync: math_1.runningAverageAsync, runningDifferenceAsync: math_1.runningDifferenceAsync, runningMaxAsync: math_1.runningMaxAsync, runningMinAsync: math_1.runningMinAsync, runningProductAsync: math_1.runningProductAsync, runningTotalAsync: math_1.runningTotalAsync, }; exports.multi = { chain: multi_1.chain, zip: multi_1.zip, zipFilled: multi_1.zipFilled, zipLongest: multi_1.zipLongest, zipEqual: multi_1.zipEqual, chainAsync: multi_1.chainAsync, zipAsync: multi_1.zipAsync, zipFilledAsync: multi_1.zipFilledAsync, zipLongestAsync: multi_1.zipLongestAsync, zipEqualAsync: multi_1.zipEqualAsync, }; exports.set = { distinct: set_1.distinct, intersection: set_1.intersection, partialIntersection: set_1.partialIntersection, symmetricDifference: set_1.symmetricDifference, union: set_1.union, distinctAsync: set_1.distinctAsync, intersectionAsync: set_1.intersectionAsync, partialIntersectionAsync: set_1.partialIntersectionAsync, symmetricDifferenceAsync: set_1.symmetricDifferenceAsync, unionAsync: set_1.unionAsync, /** * @deprecated Use `combinatorics.cartesianProduct()` instead. */ cartesianProduct: set_1.cartesianProduct, /** * @deprecated Use `combinatorics.cartesianProductAsync()` instead. */ cartesianProductAsync: set_1.cartesianProductAsync, }; exports.combinatorics = { cartesianProduct: combinatorics_1.cartesianProduct, permutations: combinatorics_1.permutations, combinations: combinatorics_1.combinations, cartesianProductAsync: combinatorics_1.cartesianProductAsync, permutationsAsync: combinatorics_1.permutationsAsync, combinationsAsync: combinatorics_1.combinationsAsync, }; exports.reduce = { toAverage: reduce_1.toAverage, toCount: reduce_1.toCount, toFirst: reduce_1.toFirst, toFirstAndLast: reduce_1.toFirstAndLast, toLast: reduce_1.toLast, toMax: reduce_1.toMax, toMin: reduce_1.toMin, toMinMax: reduce_1.toMinMax, toProduct: reduce_1.toProduct, toRange: reduce_1.toRange, toSum: reduce_1.toSum, toValue: reduce_1.toValue, toAverageAsync: reduce_1.toAverageAsync, toCountAsync: reduce_1.toCountAsync, toFirstAsync: reduce_1.toFirstAsync, toFirstAndLastAsync: reduce_1.toFirstAndLastAsync, toLastAsync: reduce_1.toLastAsync, toMaxAsync: reduce_1.toMaxAsync, toMinAsync: reduce_1.toMinAsync, toMinMaxAsync: reduce_1.toMinMaxAsync, toProductAsync: reduce_1.toProductAsync, toRangeAsync: reduce_1.toRangeAsync, toSumAsync: reduce_1.toSumAsync, toValueAsync: reduce_1.toValueAsync, }; exports.summary = { allMatch: summary_1.allMatch, allUnique: summary_1.allUnique, anyMatch: summary_1.anyMatch, exactlyN: summary_1.exactlyN, isEmpty: summary_1.isEmpty, isAsyncIterable: summary_1.isAsyncIterable, isIterable: summary_1.isIterable, isIterator: summary_1.isIterator, isReversed: summary_1.isReversed, isSorted: summary_1.isSorted, isString: summary_1.isString, noneMatch: summary_1.noneMatch, same: summary_1.same, sameCount: summary_1.sameCount, allMatchAsync: summary_1.allMatchAsync, allUniqueAsync: summary_1.allUniqueAsync, anyMatchAsync: summary_1.anyMatchAsync, exactlyNAsync: summary_1.exactlyNAsync, isEmptyAsync: summary_1.isEmptyAsync, isReversedAsync: summary_1.isReversedAsync, isSortedAsync: summary_1.isSortedAsync, noneMatchAsync: summary_1.noneMatchAsync, sameAsync: summary_1.sameAsync, sameCountAsync: summary_1.sameCountAsync, }; exports.transform = { tee: transform_1.tee, toArray: transform_1.toArray, toAsyncIterable: transform_1.toAsyncIterable, toAsyncIterator: transform_1.toAsyncIterator, toIterable: transform_1.toIterable, toIterator: transform_1.toIterator, toMap: transform_1.toMap, toSet: transform_1.toSet, teeAsync: transform_1.teeAsync, toArrayAsync: transform_1.toArrayAsync, toMapAsync: transform_1.toMapAsync, toSetAsync: transform_1.toSetAsync, }; //# sourceMappingURL=index.js.map