Closed
Description
I didn't found another issue about this example:
when a boolean has a default value that is not a boolean, the type is not coerced from v14 to the last one.
Is this the intended behaviour or could it be a bug?
var yargsParser = require("yargs-parser")
yargsParser(['--use-default'], {
boolean: ['bool'],
default: { bool: 'false' }
})
// v13 output:
// Object {_: [], bool: false, use-default: true, useDefault: true}
// from v14 output:
// Object {_: [], bool: "false", use-default: true, useDefault: true}
// if I set "42"
// Object {_: [], bool: 42, use-default: true, useDefault: true}
https://runkit.com/embed/bbdymbdxa7bc
The use case is storing some defaults value in the process.env
that are plain string and injecting them as default