Skip to content

Commit 3da715a

Browse files
nina9753ava-silver
andauthored
Update index.ts to list check
Co-authored-by: Ava Silver <ava.silver@datadoghq.com>
1 parent 82f88e1 commit 3da715a

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

src/index.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -657,11 +657,7 @@ function validateConfiguration(config: Configuration): void {
657657
}
658658

659659
function checkForMultipleApiKeys(config: Configuration): void {
660-
const definedKeys = [];
661-
if (config.apiKey !== undefined) definedKeys.push("`apiKey`");
662-
if (config.apiKMSKey !== undefined) definedKeys.push("`apiKMSKey`");
663-
if (config.apiKeySecretArn !== undefined) definedKeys.push("`apiKeySecretArn`");
664-
if (config.apiKeySsmArn !== undefined) definedKeys.push("`apiKeySsmArn`");
660+
const definedKeys = ['apiKey', 'apiKMSKey', 'apiKeySecretArn', 'apiKeySsmArn'].filter((key) => key in config).map((key) => `\`${key}\``);
665661

666662
if (definedKeys.length > 1) {
667663
let message;

0 commit comments

Comments
 (0)