ts-iterable-functions
v5.4.0
Published
[](https://npmjs.org/package/ts-iterable-functions "View this project on npm") [ => c.manufacturer),
thenBy((c) => c.model),
toArray()
);
console.log(orderedCars);
// → deterministically ordered list with full type inference at every hopWorks great for
- Data transformation pipelines in backends or frontends
- Analytics dashboards and reporting utilities
- Lightweight ETL tasks without pulling in stream frameworks
- Crafting reusable collection helpers for design systems and SDKs
- Replacing brittle nested loops with readable, testable pipelines
Pipe-first or source-first—your call
Every transformer is available as _operator(source, ...args) and operator(...args)(source).
import { _map, map, toArray } from "ts-iterable-functions";
import { pipeInto } from "ts-functional-pipe";
const numbers = [1, 2, 3];
const doubledLegacy = _map(numbers, (value) => value * 2);
const doubledPipeline = pipeInto(numbers, map((value) => value * 2), toArray());Switching between forms keeps refactors painless while preserving full generic inference.
Core building blocks
- Generators – range, repeat, repeatGenerate, fromSingleValue
- Transformers – aggregate, concat, distinctBy, groupBy, intersect, orderBy, selectMany, union, zip, and dozens more
- Aggregations – average, count, maxBy, minBy, sum
- Materializers – toArray, toLookup, toMap, toSet
Browse the full API reference in the online docs for detailed signatures and examples.
Plays nicely with ts-functional-pipe
- Leverages
pipe,pipeInto, andcomposewhile preserving discriminated unions and narrowed types - Ships lightweight helpers like indexed, groupAdjacent, and fullOuterJoin that plug directly into unary pipelines
Learn more
- Read the full documentation: biggyspender.github.io/ts-iterable-functions
- Explore class definitions and helpers: Docs hierarchy
- Generated API listings for every operator: Docs functions/_map
Heads up: versions 5.x and later are bundled with esbuild and drop IE11 support.
🤝 Contributing and community
We welcome issues, feature ideas, and pull requests. Start a conversation in issues or discussions, and check CONTRIBUTING.md before raising a PR.
