@jdsalasc/solvejs-list
v1.6.0
Published
Zero-dependency JavaScript/TypeScript list utilities for production: uniqueBy, groupBy, keyBy, partition, intersection, difference, chunk, and sortBy.
Maintainers
Readme
@jdsalasc/solvejs-list
Zero-dependency array/list utilities for JavaScript and TypeScript.
Utilities
unique,uniqueBy,compact,chunkgroupBy,keyBy,partitionintersection,differencesortBy
When to use this package
Use it when you repeatedly write list transformation logic and want consistent, tested helpers for grouping, deduplication, and sorting.
Limitations and Constraints
- Sorting/grouping semantics rely on mapper outputs and do not infer locale-aware collation.
- Large-list performance depends on data shape and key cardinality; benchmark with production-like payloads.
Install
npm i @jdsalasc/solvejs-listQuick example
import { uniqueBy, groupBy, sortBy } from "@jdsalasc/solvejs-list";
const rows = [{ id: "a", team: "x", score: 2 }, { id: "a", team: "x", score: 2 }, { id: "b", team: "y", score: 1 }];
const uniqueRows = uniqueBy(rows, (r) => r.id);
const byTeam = groupBy(uniqueRows, (r) => r.team);
sortBy(byTeam.x, (r) => r.score, "desc");Scale note
For high-volume pipelines (10k/100k rows), run npm run benchmark from the monorepo to profile uniqueBy, groupBy, and sortBy with your real data shape.
