From fc927c848e67068e6dc55ddb7c377d77eb808201 Mon Sep 17 00:00:00 2001 From: Wee Bit Date: Wed, 2 Aug 2023 02:37:29 +0300 Subject: [PATCH] Remove duplicates from ownKeys() handler's return value --- lib/command.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/command.js b/lib/command.js index bfbe57af3..b122cc4ad 100644 --- a/lib/command.js +++ b/lib/command.js @@ -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; },