fix: Use non-global flag whilst resolving regular expressions

v13.9.0 #8178
This commit is contained in:
Cinnamon 2022-07-01 10:36:24 +07:00
parent 0d0ab7767c
commit 1e9b4c3775

View File

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