fix: Use non-global flag whilst resolving regular expressions (#8178)

fix(DataResolver): remove global flag on resolving
This commit is contained in:
Jiralite
2022-06-29 23:39:48 +01:00
committed by GitHub
parent 0e0f784447
commit 4063b90cef

View File

@@ -34,7 +34,7 @@ class DataResolver extends null {
* @returns {string}
*/
static resolveCode(data, regex) {
return data.matchAll(regex).next().value?.[1] ?? data;
return new RegExp(regex.source).exec(data)?.[1] ?? data;
}
/**