mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-18 12:33:30 +01:00
fix: Use non-global flag whilst resolving regular expressions (#8178)
fix(DataResolver): remove global flag on resolving
This commit is contained in:
@@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user