refactor(generators): use Map.groupBy in groupNodesByModule - #956
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
PR SummaryLow Risk Overview Grouping is still keyed by each entry’s Reviewed by Cursor Bugbot for commit 48f85db. Bugbot is set up for automated code reviews on this repo. Configure here. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #956 +/- ##
==========================================
- Coverage 86.52% 86.51% -0.01%
==========================================
Files 195 195
Lines 17974 17963 -11
Branches 1633 1632 -1
==========================================
- Hits 15552 15541 -11
Misses 2416 2416
Partials 6 6 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Description
Replaces the hand-rolled Map grouping loop in groupNodesByModule with the native Map.groupBy() static method. It groups an iterable by the value returned from a callback, which is semantically identical to the previous implementation — a behavior-neutral simplification that reduces boilerplate and improves readability.
Map.groupBy()requires Node.js ≥ 21 (V8 12.0); the project's .nvmrc pins Node 24, so this is safe.https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/groupBy
Validation
Related Issues
Check List
node --run testand all tests passed.node --run format&node --run lint.