New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
parserConfiguration "strip-aliased" causes "coerce" not be applied for expanded-camelcase #2307
Comments
I was not able to reproduce this with const argv = require('yargs-parser')(["--n-e", "1"],
{
coerce: { 'n-e': n => n + 1 },
// alias: { 'n-e': 'not-ever' },
configuration: {
'strip-aliased': true,
}
}
);
console.log(argv) % node parser.js --n-e 1
{ _: [], 'n-e': 2, nE: 2 } |
I can reproduce the issue calling yargs, like in your reproduction steps. I think the bug is downstream in yargs. |
Possibly related: #2159 |
At this point in the parsing, the Line 412 in 2b6ba31
|
There were problems mixing coerce with parser configuration which removes keys from argv. I took a more general approach in #2308 to remove assumptions about configuration. |
without is ok
The text was updated successfully, but these errors were encountered: