Skip to content

Commit

Permalink
cleaned the keyword definition
Browse files Browse the repository at this point in the history
  • Loading branch information
pazhersh committed May 21, 2024
1 parent a981575 commit d02e74c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/template.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {{ <Keyword>() }} with white spaces where you'd expect them

if (key.match(keywordMatcher)) {
const evaluatedValue = renderRecursively(inputJson, value, execOptions);
Expand Down

0 comments on commit d02e74c

Please sign in to comment.