Improving performance

This commit is contained in:
Liyas Thomas
2019-11-28 20:41:52 +05:30
parent 2a81c2611b
commit b10a209daf
28 changed files with 1028 additions and 585 deletions

View File

@@ -3,5 +3,5 @@ export default function parseTemplateString(string, variables) {
return string;
}
const searchTerm = /<<([^>]*)>>/g; // "<<myVariable>>"
return string.replace(searchTerm, (match, p1) => variables[p1] || '');
return string.replace(searchTerm, (match, p1) => variables[p1] || "");
}