Add Web/Desktop specific plugin capabilities; misc fixes

This commit is contained in:
Vendicated
2023-03-11 14:18:32 +01:00
parent 3b945b87b8
commit 5d1283bd85
11 changed files with 89 additions and 85 deletions

View File

@ -32,14 +32,14 @@ export default definePlugin({
authors: [Devs.Ven],
getShortcuts() {
function newFindWrapper(filterFactory: (props: any) => Webpack.FilterFn) {
const cache = new Map<string, any>();
function newFindWrapper(filterFactory: (...props: any[]) => Webpack.FilterFn) {
const cache = new Map<string, unknown>();
return function (filterProps: any) {
return function (...filterProps: unknown[]) {
const cacheKey = String(filterProps);
if (cache.has(cacheKey)) return cache.get(cacheKey);
const matches = findAll(filterFactory(filterProps));
const matches = findAll(filterFactory(...filterProps));
const result = (() => {
switch (matches.length) {