diff --git a/templater.js b/templater.js index 4acab6a..9e1f7f6 100644 --- a/templater.js +++ b/templater.js @@ -1,5 +1,5 @@ function templater(templateString, dataObj) { - return templateString.replace(/\$\{(\w+)\}/g, "$1") + return templateString.replace(/\$\{(\w+)\}/g, (a, b) => dataObj[b]) } templater('${who} ${action} ${what}', {