Transformer: grouping loops to Object.groupBy()/Map.groupBy()
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 69/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- javascript
- Domain
- tooling
Research direction
Read the existing transformer rules and tests in the repository to find how loop-based accumulator transformations are implemented. Add coverage for the shown Object accumulator and Map accumulator patterns, including Object.groupBy()'s null-prototype result. Done when the transformations are covered by passing tests.
Written by the indexing model from the issue text.
Description
// before
const byType = {};
for (const item of items) {
const group = (byType[item.type] ??= []);
group.push(item);
}
// after
const byType = Object.groupBy(items, (item) => item.type);
Same for Map accumulators via Map.groupBy(). Note Object.groupBy() returns a null-prototype object.
Baseline: widely available (all browsers since 2024-03-05).
- Dominant language
- JavaScript
- Stars
- 15
- Forks
- 2
- Avg merge
- 2h 9m
- Merged PRs (30d)
- 28
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from codingjoe/esupgrade
-
widely available
Difficulty 3/5 1-2 days Newbie friendliness 72/100
codingjoe/esupgrade#217 · 1 comment ·
Maintainers usually reply within 1 day
-
newly available
Difficulty 3/5 1-2 days Newbie friendliness 66/100
codingjoe/esupgrade#211 · 1 comment ·
Maintainers usually reply within 1 day
-
widely available
Difficulty 3/5 1-2 days Newbie friendliness 72/100
codingjoe/esupgrade#212 · 1 comment ·
Maintainers usually reply within 1 day
-
widely available
Difficulty 3/5 1-2 days Newbie friendliness 68/100
codingjoe/esupgrade#213 · 1 comment ·
Maintainers usually reply within 1 day
-
newly available
Difficulty 3/5 1-2 days Newbie friendliness 70/100
codingjoe/esupgrade#145 · 1 comment ·
Maintainers usually reply within 1 day
All issues in codingjoe/esupgrade
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 2 days
-
area-clientside-dartpad
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
alphagov/public-asset-checker#378 · 1 comment ·
Maintainers usually reply within 1 day
-
S: triage
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
apache/rocketmq-dashboard#7242 ·
Maintainers usually reply within 3 days