From fca788f424f0366407fd9e7e4a52d5df07be590a Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Tue, 22 Sep 2020 10:33:25 +0100 Subject: [PATCH] One final change, match is likely better than matchAll due to the global nature of the regex and its lack of capture groups currently (in workflow mustache cleansing). --- packages/server/src/workflows/thread.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/server/src/workflows/thread.js b/packages/server/src/workflows/thread.js index ab494e327..afcbd836c 100644 --- a/packages/server/src/workflows/thread.js +++ b/packages/server/src/workflows/thread.js @@ -10,10 +10,10 @@ function cleanMustache(string) { "]": "", } let regex = new RegExp(/{{[^}}]*}}/g) - for (let match of string.matchAll(regex)) { + for (let match of string.match(regex)) { let baseIdx = string.indexOf(match) for (let key of Object.keys(charToReplace)) { - let idxChar = match[0].indexOf(key) + let idxChar = match.indexOf(key) if (idxChar !== -1) { string = string.slice(baseIdx, baseIdx + idxChar) +