From b9bd81929cacf3716cd8274ec5389dd5de88a34a Mon Sep 17 00:00:00 2001 From: rishabhr4 <118053976+rishabhr4@users.noreply.github.com> Date: Thu, 3 Oct 2024 14:32:31 +0530 Subject: [PATCH] Update customFilters.js used optional chain expression --- apps/nunjucks-filters/src/customFilters.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/nunjucks-filters/src/customFilters.js b/apps/nunjucks-filters/src/customFilters.js index 670554fa3..7d5339f17 100644 --- a/apps/nunjucks-filters/src/customFilters.js +++ b/apps/nunjucks-filters/src/customFilters.js @@ -198,7 +198,7 @@ function replaceServerVariablesWithValues(url, serverVariables) { const getVariableValue = (object, variable) => { const keyValue = object[variable]._json; - if (keyValue) return keyValue.default || (keyValue.enum && keyValue.enum[0]); + if (keyValue) return keyValue.default ?? keyValue.enum?.[0]; }; const urlVariables = getVariablesNamesFromUrl(url);