Skip to content

Commit 394c7a0

Browse files
committed
Alleviate weird issue with duplicate handling
This is still a bug, albeit one less glaring than before. This module is in dire need of a full rewrite...
1 parent 2ecab5e commit 394c7a0

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

index.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -524,18 +524,17 @@ function getOpts(input, optdef = null, config = {}){
524524
else{
525525
const {names} = option;
526526

527-
// Ascertain if this option's being duplicated
528-
if(result.options[ names[0] ])
529-
value = resolveDuplicate(option, value);
530-
531-
532-
option.names.forEach(name => {
527+
for(let name of names){
533528

534529
// Decide whether to camelCase this option name
535530
name = formatName(name, noCamelCase);
536531

532+
// Ascertain if this option's being duplicated
533+
if(result.options[name])
534+
resolveDuplicate(option, name, value);
535+
537536
result.options[name] = value;
538-
});
537+
}
539538
}
540539
}
541540

0 commit comments

Comments
 (0)