Skip to content

Commit

Permalink
Remove duplicates from ownKeys() handler's return value
Browse files Browse the repository at this point in the history
  • Loading branch information
aweebit committed Aug 1, 2023
1 parent 040ff88 commit fc927c8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/command.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ class CommandBase extends EventEmitter {
ownKeys(target) {
const result = Reflect.ownKeys(target);
if (target._storeOptionsAsProperties) {
result.push(...Reflect.ownKeys(target._optionValuesProxy));
result.push(...Reflect.ownKeys(target._optionValuesProxy).filter(
key => !(result.includes(key)) // remove duplicates
));
}
return result;
},
Expand Down

0 comments on commit fc927c8

Please sign in to comment.