Consider this block:
|
Object.keys(opts.alias || {}).forEach(function (key) { |
|
aliases[key] = [].concat(opts.alias[key]); |
|
aliases[key].forEach(function (x) { |
|
aliases[x] = [key].concat(aliases[key].filter(function (y) { |
|
return x !== y; |
|
})); |
|
}); |
|
}); |
|
|
|
[].concat(opts.string).filter(Boolean).forEach(function (key) { |
|
flags.strings[key] = true; |
|
if (aliases[key]) { |
|
flags.strings[aliases[key]] = true; |
|
} |
|
}); |
Here it builds an array of aliased args:
|
aliases[x] = [key].concat(aliases[key].filter(function (y) { |
|
return x !== y; |
|
})); |
And here it uses this array as a key for strings:
|
flags.strings[aliases[key]] = true; |
Which will just result in:
{
strings: {
"[object Object]": true
}
}
It should either build flat aliases or iterate over the nested array
Consider this block:
minimist/index.js
Lines 52 to 66 in 62fde7d
Here it builds an array of aliased args:
minimist/index.js
Lines 55 to 57 in 62fde7d
And here it uses this array as a key for strings:
minimist/index.js
Line 64 in 62fde7d
Which will just result in:
It should either build flat aliases or iterate over the nested array