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
Inconsistent array parsing when value is passed through config() option #789
@bcoe the reason I was sure it was going to work is that it works for other types of values. If I pass 'true' and the type of this option is boolean the resulting value's going to be true. Same works with numbers. In my case I've added a preprocessing step before passing config to yarn where I parse array option(if it's value is string).
Activity
le0nik commentedon Feb 19, 2017
Found that it's an issue with https://github.com/yargs/yargs-parser. Maybe something like https://github.com/mccormicka/string-argv could be used to parse strings into arrays.
bcoe commentedon Feb 21, 2017
@le0nik I believe this is expected behavior, when passing config, this should be the already parsed values, so you'd pass something like this:
Which could be overridden with:
foo.js --arr foo barIs it wort adding a note to our documentation on this topic?
le0nik commentedon Feb 21, 2017
@bcoe the reason I was sure it was going to work is that it works for other types of values. If I pass
'true'and thetypeof this option isbooleanthe resulting value's going to betrue. Same works with numbers. In my case I've added a preprocessing step before passing config to yarn where I parse array option(if it's value is string).bcoe commentedon Feb 21, 2017
@le0nik valid point, perhaps open an issue on
yargs-parserI'd definitely consider supporting this.