From 7653eaf1464e3ca350b79e2e6f8a5937ae017652 Mon Sep 17 00:00:00 2001 From: ItzCrazyKns Date: Tue, 23 Apr 2024 16:54:39 +0530 Subject: [PATCH] feat(config): avoid updating blank fields --- src/config.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/config.ts b/src/config.ts index 7929ba7..f373847 100644 --- a/src/config.ts +++ b/src/config.ts @@ -55,11 +55,15 @@ export const updateConfig = (config: RecursivePartial) => { if (currentConfig[key] && typeof currentConfig[key] === 'object') { for (const nestedKey in currentConfig[key]) { - if (currentConfig[key][nestedKey] && !config[key][nestedKey]) { + if ( + currentConfig[key][nestedKey] && + !config[key][nestedKey] && + config[key][nestedKey] !== '' + ) { config[key][nestedKey] = currentConfig[key][nestedKey]; } } - } else if (currentConfig[key] && !config[key]) { + } else if (currentConfig[key] && !config[key] && config[key] !== '') { config[key] = currentConfig[key]; } }