mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-15 17:43:08 -04:00
feat(plugins): ConsoleJanitor (#2659)
This commit is contained in:
parent
99b41dba19
commit
256a85c95c
4 changed files with 161 additions and 3 deletions
|
@ -59,11 +59,15 @@ export function addPatch(newPatch: Omit<Patch, "plugin">, pluginName: string) {
|
|||
delete patch.group;
|
||||
}
|
||||
|
||||
if (patch.predicate && !patch.predicate()) return;
|
||||
|
||||
canonicalizeFind(patch);
|
||||
if (!Array.isArray(patch.replacement)) {
|
||||
patch.replacement = [patch.replacement];
|
||||
}
|
||||
|
||||
patch.replacement = patch.replacement.filter(({ predicate }) => !predicate || predicate());
|
||||
|
||||
if (IS_REPORTER) {
|
||||
patch.replacement.forEach(r => {
|
||||
delete r.predicate;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue