mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-15 17:43:08 -04:00
Optimize slowest patches
This commit is contained in:
parent
1866e4d379
commit
8f59cd8a1a
14 changed files with 33 additions and 33 deletions
|
@ -31,10 +31,10 @@ export default definePlugin({
|
|||
// Some modules match the find but the replacement is returned untouched
|
||||
noWarn: true,
|
||||
replacement: {
|
||||
match: /canAnimate:.+?(?=([,}].*?\)))/g,
|
||||
match: /canAnimate:.+?([,}].*?\))/g,
|
||||
replace: (m, rest) => {
|
||||
const destructuringMatch = rest.match(/}=.+/);
|
||||
if (destructuringMatch == null) return "canAnimate:!0";
|
||||
if (destructuringMatch == null) return `canAnimate:!0${rest}`;
|
||||
return m;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue