aboutsummaryrefslogtreecommitdiffhomepage
path: root/interpolate.js
diff options
context:
space:
mode:
authorAmine El Baghdadi <75886237+NoobJsPerson@users.noreply.github.com> 2021-05-15 18:14:56 +0000
committerAmine El Baghdadi <75886237+NoobJsPerson@users.noreply.github.com> 2021-05-15 18:14:56 +0000
commit3ff1e092aa759182c1e5f9335f0a8889ce373c68 (patch)
tree71f0a89e1c04a1a848e9a0a3fbdc4fea4d1ec600 /interpolate.js
parent8c1853eb39ea4d251e00392f802df32233b83325 (diff)
update interpolate.js
Diffstat (limited to 'interpolate.js')
-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);
});