Skip to content
This repository has been archived by the owner on Mar 10, 2024. It is now read-only.

Commit

Permalink
Exclude empty values from recursion (#260)
Browse files Browse the repository at this point in the history
  • Loading branch information
qetza authored Mar 13, 2022
1 parent 05201e7 commit 64e8c9d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions tasks/ReplaceTokensV3/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -318,8 +318,8 @@ var replaceTokensInString = function (
if (options.useLegacyEmptyFeature && options.emptyValue && value === options.emptyValue) // old empty/default feature
value = '';

// apply recursion on value (never apply escape)
if (options.enableRecursion)
// apply recursion on non-empty value (never apply escape)
if (value && options.enableRecursion)
value = replaceTokensInString(value, regex, transformRegex, options, false, escapeType, counter, names + name);

// apply transformation
Expand Down
4 changes: 2 additions & 2 deletions tasks/ReplaceTokensV4/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -318,8 +318,8 @@ var replaceTokensInString = function (
if (options.useLegacyEmptyFeature && options.emptyValue && value === options.emptyValue) // old empty/default feature
value = '';

// apply recursion on value (never apply escape)
if (options.enableRecursion)
// apply recursion on non-empty value (never apply escape)
if (value && options.enableRecursion)
value = replaceTokensInString(value, regex, transformRegex, options, false, escapeType, counter, names + name);

// apply transformation
Expand Down
4 changes: 2 additions & 2 deletions tasks/ReplaceTokensV5/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -318,8 +318,8 @@ var replaceTokensInString = function (
if (options.useLegacyEmptyFeature && options.emptyValue && value === options.emptyValue) // old empty/default feature
value = '';

// apply recursion on value (never apply escape)
if (options.enableRecursion)
// apply recursion on non-empty value (never apply escape)
if (value && options.enableRecursion)
value = replaceTokensInString(value, regex, transformRegex, options, false, escapeType, counter, names + name);

// apply transformation
Expand Down

0 comments on commit 64e8c9d

Please sign in to comment.