From 3ff1e092aa759182c1e5f9335f0a8889ce373c68 Mon Sep 17 00:00:00 2001 From: Amine El Baghdadi <75886237+NoobJsPerson@users.noreply.github.com> Date: Sat, 15 May 2021 18:14:56 +0000 Subject: update interpolate.js --- interpolate.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'interpolate.js') 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); }); -- cgit v1.2.3