From e1fa5516d2b5d64bc57e6ce22a7c5d11906d042e Mon Sep 17 00:00:00 2001 From: "Connor Bell (Makeshift)" Date: Thu, 5 Jan 2023 15:42:41 +0000 Subject: [PATCH] [patch] Actually make the string template parse regex work --- dist/index.js | 2 +- src/index.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/index.js b/dist/index.js index 05afd5a..99768e0 100644 --- a/dist/index.js +++ b/dist/index.js @@ -10272,7 +10272,7 @@ const globOpts = { } function parseStringTemplate (str, obj) { - const parts = str.split(/\$\{(?!\d)[\wæøåÆØÅ]*\}/) + const parts = str.split(/\$\{(?!\d)[\wæøåÆØÅ-]*\}/) const args = str.match(/[^{}]+(?=})/g) || [] const parameters = args.map(argument => obj[argument] || (obj[argument] === undefined ? '' : obj[argument])) return String.raw({ raw: parts }, ...parameters) diff --git a/src/index.js b/src/index.js index 16d86c5..e21b1fc 100644 --- a/src/index.js +++ b/src/index.js @@ -21,7 +21,7 @@ const globOpts = { } function parseStringTemplate (str, obj) { - const parts = str.split(/\$\{(?!\d)[\wæøåÆØÅ]*\}/) + const parts = str.split(/\$\{(?!\d)[\wæøåÆØÅ-]*\}/) const args = str.match(/[^{}]+(?=})/g) || [] const parameters = args.map(argument => obj[argument] || (obj[argument] === undefined ? '' : obj[argument])) return String.raw({ raw: parts }, ...parameters)