From 23c97c471a4b7194aaac0620e935341de07eb1ad Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Tue, 19 Mar 2024 20:53:00 +0100 Subject: [PATCH] refactor: strong stype configuration key deprecation helper MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/utils/Configuration.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/utils/Configuration.ts b/src/utils/Configuration.ts index e1fd11c7..9356785d 100644 --- a/src/utils/Configuration.ts +++ b/src/utils/Configuration.ts @@ -513,22 +513,22 @@ export class Configuration { private static warnDeprecatedConfigurationKey ( key: string, - sectionName?: string, + configurationSection?: ConfigurationSection, logMsgToAppend = '' ): void { if ( - sectionName != null && - Configuration.getConfigurationData()?.[sectionName as keyof ConfigurationData] != null && + configurationSection != null && + Configuration.getConfigurationData()?.[configurationSection as keyof ConfigurationData] != + null && ( - Configuration.getConfigurationData()?.[sectionName as keyof ConfigurationData] as Record< - string, - unknown - > + Configuration.getConfigurationData()?.[ + configurationSection as keyof ConfigurationData + ] as Record )[key] != null ) { console.error( `${chalk.green(logPrefix())} ${chalk.red( - `Deprecated configuration key '${key}' usage in section '${sectionName}'${ + `Deprecated configuration key '${key}' usage in section '${configurationSection}'${ logMsgToAppend.trim().length > 0 ? `. ${logMsgToAppend}` : '' }` )}` -- 2.34.1