Skip to content

Commit

Permalink
fix: Use non-global flag whilst resolving regular expressions (#8178)
Browse files Browse the repository at this point in the history
fix(DataResolver): remove global flag on resolving
  • Loading branch information
Jiralite committed Jun 29, 2022
1 parent 0e0f784 commit 4063b90
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/util/DataResolver.js
Expand Up @@ -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;
}

/**
Expand Down

0 comments on commit 4063b90

Please sign in to comment.