From 8d54dcc02f185433399891be628fe8ce7658e2d1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Tue, 7 Feb 2023 22:05:01 +0100 Subject: [PATCH] fix(simulator): detect string emptiness properly without helper usage 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 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/utils/Configuration.ts b/src/utils/Configuration.ts index 2cba674d..c71b3ee5 100644 --- a/src/utils/Configuration.ts +++ b/src/utils/Configuration.ts @@ -339,13 +339,13 @@ export default class Configuration { ) { console.error( chalk`{green ${Configuration.logPrefix()}} {red Deprecated configuration key '${key}' usage in section '${sectionName}'${ - logMsgToAppend.trim().length !== 0 && `. ${logMsgToAppend}` + logMsgToAppend.trim().length > 0 && `. ${logMsgToAppend}` }}` ); } else if (!Configuration.isUndefined(Configuration.getConfig()[key])) { console.error( chalk`{green ${Configuration.logPrefix()}} {red Deprecated configuration key '${key}' usage${ - logMsgToAppend.trim().length !== 0 && `. ${logMsgToAppend}` + logMsgToAppend.trim().length > 0 && `. ${logMsgToAppend}` }}` ); } @@ -376,7 +376,7 @@ export default class Configuration { private static getConfigurationFileWatcher(): fs.FSWatcher | undefined { try { return fs.watch(Configuration.configurationFile, (event, filename): void => { - if (filename?.trim().length !== 0 && event === 'change') { + if (filename?.trim().length > 0 && event === 'change') { // Nullify to force configuration file reading Configuration.configuration = null; if (!Configuration.isUndefined(Configuration.configurationChangeCallback)) { @@ -432,7 +432,7 @@ export default class Configuration { logPrefix: string, params: HandleErrorParams = { throwError: true } ): void { - const prefix = logPrefix?.trim().length !== 0 ? `${logPrefix} ` : ''; + const prefix = logPrefix?.trim().length > 0 ? `${logPrefix} ` : ''; let logMsg: string; switch (error.code) { case 'ENOENT': -- 2.34.1