diff options
author | Amine El Baghdadi <75886237+NoobJsPerson@users.noreply.github.com> | 2021-05-15 18:14:56 +0000 |
---|---|---|
committer | Amine El Baghdadi <75886237+NoobJsPerson@users.noreply.github.com> | 2021-05-15 18:14:56 +0000 |
commit | 3ff1e092aa759182c1e5f9335f0a8889ce373c68 (patch) | |
tree | 71f0a89e1c04a1a848e9a0a3fbdc4fea4d1ec600 /interpolate.js | |
parent | 8c1853eb39ea4d251e00392f802df32233b83325 (diff) |
update interpolate.js
Diffstat (limited to 'interpolate.js')
-rw-r--r-- | interpolate.js | 4 |
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);
});
|