You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Existence of ‘number’ Key in Options.arrays Changes Parsing #415
The documentation says to set numbers: true to parse option-array values as numbers. However, this value can be anything other than true and yargs will still use number parsing. This is particularly confusing when trying to set numbers: false or numbers: undefined.
Thanks for the compact examples using the node REPL.
I see how you were confused, but the intended way of preventing the automatic number conversion is to set string: true.
In general terms, options may be boolean or string or number. Setting number: false is not enough to tell yargs-parser what you intend.
yargs-parser could throw a configuration error, but this issue has not been upvoted in a few years and unlikely to change behaviour based on current information.
Activity
bcoe commentedon Oct 4, 2021
@JoeDailey thank you for bug report.
shadowspawn commentedon Oct 10, 2026
Thanks for the compact examples using the node REPL.
I see how you were confused, but the intended way of preventing the automatic number conversion is to set
string: true.In general terms, options may be
booleanorstringornumber. Settingnumber: falseis not enough to tell yargs-parser what you intend.yargs-parser could throw a configuration error, but this issue has not been upvoted in a few years and unlikely to change behaviour based on current information.