mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-16 01:53:05 -04:00
feat: Allow finds to use regex (#2452)
This commit is contained in:
parent
4da8b9aad7
commit
f74da73086
3 changed files with 46 additions and 13 deletions
|
@ -257,7 +257,12 @@ function patchFactories(factories: Record<string, (module: any, exports: any, re
|
|||
for (let i = 0; i < patches.length; i++) {
|
||||
const patch = patches[i];
|
||||
if (patch.predicate && !patch.predicate()) continue;
|
||||
if (!code.includes(patch.find)) continue;
|
||||
|
||||
const moduleMatches = typeof patch.find === "string"
|
||||
? code.includes(patch.find)
|
||||
: patch.find.test(code);
|
||||
|
||||
if (!moduleMatches) continue;
|
||||
|
||||
patchedBy.add(patch.plugin);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue