From 0e3478b46ebb086d08fe7e41a87de8110d99e08d Mon Sep 17 00:00:00 2001 From: Bedi Gupta Date: Mon, 14 Oct 2024 15:01:21 +0530 Subject: [PATCH] refactor: use optional chaining in template validator (#1300) --- apps/generator/lib/templateConfigValidator.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/generator/lib/templateConfigValidator.js b/apps/generator/lib/templateConfigValidator.js index 3b57ef759..9e075b98b 100644 --- a/apps/generator/lib/templateConfigValidator.js +++ b/apps/generator/lib/templateConfigValidator.js @@ -97,7 +97,7 @@ function getParamSuggestion(wrongParam, configParams) { * @param {Object} templateParams All parameters provided to generator */ function isProvidedParameterSupported(configParams, templateParams) { - const wrongParams = Object.keys(templateParams || {}).filter(key => !configParams || !configParams[key]); + const wrongParams = Object.keys(templateParams || {}).filter(key => !configParams?.[key]); if (!wrongParams.length) return; if (!configParams) throw new Error('This template doesn\'t have any params.');