mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +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}
|
||||
*/
|
||||
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