LetsMelon / LetsMelon/addIdToArray

Generated id < 0

Open
#8 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug help wanted invalid
Dominant language
JavaScript
Stars
2
Forks
0
PR merge metrics
No merged PRs in 30d

Description

Question

Should this behaviour (see examples) be fixed?

Examples
1. parameter.incrementStep = -5
addIdToArray(
  [
    { name: 'Jeff', age: 19 },
    { name: 'Maria', age: 20 },
  ],
  { headers: 'person', incrementStep: -5 }
);
/* --> [
 *   { id: 1, person: { name: 'Jeff', age: 19 } },
 *   { id: -4, person: { name: 'Maria', age: 20 } }
 * ]
 */

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The entry point shown is addIdToArray; inspect how incrementStep is applied when it is negative and check whether existing tests cover this case. Clarify the intended behavior for a negative step, then add a regression test and confirm the resulting IDs match the agreed expectation.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
tooling
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.