-
Notifications
You must be signed in to change notification settings - Fork 123
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
.pkgConf(), .normalize() and .array() not working well together #37
Comments
After @bcoe's answer in the previous issue I've run a couple of additional experiments and found that if the options are passed through cli instead of
I've searched through the code looking for some possible causes. The error pointed to line 344, in the function // Set normalized value when key is in 'normalize' and in 'arrays'
if (checkAllAliases(key, flags.normalize) && checkAllAliases(key, flags.arrays)) {
value = path.normalize(val)
} I haven't thoroughly examined the source and I'm not familiar with the whole parsing process, but a quick peek tells that when a config object is used, the function I guess possible fixes would be for // Set normalized value when key is in 'normalize' and in 'arrays'
if (checkAllAliases(key, flags.normalize) && checkAllAliases(key, flags.arrays)) {
if (Array.isArray(val)) value = val.map(path.normalize)
else value = path.normalize(val)
} Or forcing |
Ok, a bit of issue-digging later it looks like |
(Originally notified in yargs/yargs#536)
The above code paired with a package.json containing
crashes throwing
TypeError: Path must be a string. Received [ 'bin/../a.txt', 'bin/../b.txt' ]
.The text was updated successfully, but these errors were encountered: