From d02e74cba0055ac01cd59a55e2a84f1c20b617de Mon Sep 17 00:00:00 2001 From: Paz Hershberg Date: Tue, 21 May 2024 09:02:52 +0300 Subject: [PATCH] cleaned the keyword definition --- lib/template.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/template.js b/lib/template.js index c857415..1aeafa8 100644 --- a/lib/template.js +++ b/lib/template.js @@ -93,8 +93,8 @@ const renderRecursively = (inputJson, template, execOptions = {}) => { if (typeof template === 'object' && template !== null) { return Object.fromEntries( Object.entries(template).flatMap(([key, value]) => { - const TEMP_SPREAD_KEYWORD_ESCAPED = "tempSpreadKeyword\\(\\)"; - const keywordMatcher = `^\\{\\{\\s*${TEMP_SPREAD_KEYWORD_ESCAPED}\\s*\\}\\}$`; + const SPREAD_KEYWORD = "tempSpreadKeyword"; + const keywordMatcher = `^\\{\\{\\s*${SPREAD_KEYWORD}\\(\s*\\)\\s*\\}\\}$`; // matches {{ () }} with white spaces where you'd expect them if (key.match(keywordMatcher)) { const evaluatedValue = renderRecursively(inputJson, value, execOptions);