aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--interpolate.js4
1 files changed, 1 insertions, 3 deletions
diff --git a/interpolate.js b/interpolate.js
index 70ac4eb..0c20589 100644
--- a/interpolate.js
+++ b/interpolate.js
@@ -1,7 +1,5 @@
-const regex = /\${[^{]+}/g;
-
export default function interpolate(template, variables) {
- return template.replace(regex, (match) => {
+ return template.replace(/\${[^{]+}/g, (match) => {
const path = match.slice(2, -1).trim();
return getObjPath(path, variables);
});