Skip to content

Parse negative values for numeric parser types#79

Draft
Jaksenc wants to merge 1 commit into
vercel:mainfrom
Jaksenc:codex/negative-number-parsers
Draft

Parse negative values for numeric parser types#79
Jaksenc wants to merge 1 commit into
vercel:mainfrom
Jaksenc:codex/negative-number-parsers

Conversation

@Jaksenc
Copy link
Copy Markdown

@Jaksenc Jaksenc commented May 14, 2026

Summary

  • recognize parseInt and parseFloat as numeric parser types when deciding whether a required option may consume a following negative-looking value
  • preserve the existing strict behavior for non-numeric-looking options such as -abc and for non-numeric option types like String
  • carry the same numeric metadata through array parser specs so [Number] and [parseInt] handle separate negative values too

Fixes #52.

Verification

  • npm test
  • npx prettier --check index.js test.js
  • git diff --check
  • node --check index.js
  • npx -p node@20 node node_modules/jest/bin/jest.js --coverage -w 2

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.

Issues parsing negative numbers when passed without =

1 participant