Skip to content

fix(setKey): use a sentinel to detect count auto-increment#529

Open
SAY-5 wants to merge 1 commit into
yargs:mainfrom
SAY-5:fix/count-sentinel
Open

fix(setKey): use a sentinel to detect count auto-increment#529
SAY-5 wants to merge 1 commit into
yargs:mainfrom
SAY-5:fix/count-sentinel

Conversation

@SAY-5
Copy link
Copy Markdown

@SAY-5 SAY-5 commented May 13, 2026

The TypeScript conversion changed value === increment (function reference used as a sentinel) to value === increment() (which returns 1), so any later occurrence of a non-count argument with value 1 is incorrectly incremented onto the previous value (parser('-x 3 -x 1') returns { x: 4 } instead of { x: [3, 1] }). Restored the original semantics with a Symbol sentinel that flows from processValue to setKey.

Closes #506

@shadowspawn
Copy link
Copy Markdown
Member

To be clear: is this PR entirely AI/LLM generated?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Multiple arguments are incremented if they are equal to 1.

2 participants