From 25c4e53c06282e21f037ff61485cc3c594e043ac Mon Sep 17 00:00:00 2001 From: Bedi Gupta Date: Tue, 15 Oct 2024 13:25:53 +0530 Subject: [PATCH] refactor: better readability of `buildLineCore` filter (#1301) Co-authored-by: Lukasz Gornicki --- apps/nunjucks-filters/src/customFilters.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/nunjucks-filters/src/customFilters.js b/apps/nunjucks-filters/src/customFilters.js index 83ef06fbb..0914c821a 100644 --- a/apps/nunjucks-filters/src/customFilters.js +++ b/apps/nunjucks-filters/src/customFilters.js @@ -150,9 +150,11 @@ function docline(field, fieldName, scopePropName) { const getPName = (pName) => pName ? `${pName}.` : ''; const buildLineCore = (type, def, pName, fName) => { - return `* @param {${type}} ${pName}${fName}${def !== undefined ? `=${def}` : ''}`; + const paramName = `${pName}${fName}`; + const defaultValue = def !== undefined ? `=${def}` : ''; + return `* @param {${type}} ${paramName}${defaultValue}`; }; - + const buildLine = (f, fName, pName) => { const type = getType(f); const def = getDefault(f, type);