Repository navigation
Conversation
Constraint: Keep the existing boolean-option semantics and Node runtime floor. Confidence: high Scope-risk: narrow Tested: Failing-first regression, all 177 assertions, ESLint, and public API CLI with an empty shell argument. AI-assistance: Implementation and tests prepared with OpenAI Codex.
Member
|
This looks like a drive-by AI Pull Request. The account created 30 Pull Requests in a single day. That said, I think the current behaviour is not as intended. But fixing it might have to be semver major, because although an uncommon case, lots of historical usage! This is commentary, not a review. |
shadowspawn
reviewed
Sep 12, 2026
| t.deepEqual(parse(['-s', '', 'tail']), { s: '', _: ['tail'] }); | ||
| t.deepEqual(parse(['-s', '', 'tail'], { string: 's' }), { s: '', _: ['tail'] }); | ||
| t.deepEqual(parse(['-as', '', 'tail']), { a: true, s: '', _: ['tail'] }); | ||
| t.deepEqual(parse(['-s', ''], { alias: { s: 'string' } }), { s: '', string: '', _: [] }); |
Member
There was a problem hiding this comment.
This test would be more appropriate with string long option name declared in opts.string, and s alias.
The current test is a somewhat unlikely looking edge case.
shadowspawn
reviewed
Sep 12, 2026
| t.deepEqual(parse(['-as', '', 'tail']), { a: true, s: '', _: ['tail'] }); | ||
| t.deepEqual(parse(['-s', ''], { alias: { s: 'string' } }), { s: '', string: '', _: [] }); | ||
| t.deepEqual(parse(['-b', ''], { boolean: 'b' }), { b: true, _: [''] }); | ||
| t.deepEqual(parse(['-s']), { s: true, _: [] }); |
Member
There was a problem hiding this comment.
This test is of existing behaviour and does not look necessary.
Member
|
For reference, I think this is the relevant line mentioned for the long option ( Line 176 in ecfdaea |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When an empty shell argument follows a short option (
-s ''), minimist currently setss: trueand leaves the empty string in positional arguments. The equivalent long option already consumes the empty value.Check whether the following argument is undefined, matching the long-option branch. The regression covers inferred and declared strings, short groups, aliases, and unchanged boolean/missing-value behavior.
Validation: failing-first regression; all 177 assertions pass with
npm run tests-only;npm run lintpasses (existing warnings); direct CLI invocation of this checkout returns{ _: ['tail'], s: '' }for-s '' tail. Tested on Node 26.4.0; historical runtime floor and posttest network audit not exercised.AI disclosure: OpenAI Codex assisted with investigation, implementation, tests, and this description.