mirror of
https://github.com/Vendicated/Vencord.git
synced 2025-01-25 08:46:25 +00:00
update imports
This commit is contained in:
parent
d791eb0e1c
commit
6c93b4d7ec
1 changed files with 2 additions and 8 deletions
|
@ -22,7 +22,7 @@ import { Devs } from "@utils/constants";
|
||||||
import { Logger } from "@utils/Logger";
|
import { Logger } from "@utils/Logger";
|
||||||
import { canonicalizeMatch, canonicalizeReplace } from "@utils/patches";
|
import { canonicalizeMatch, canonicalizeReplace } from "@utils/patches";
|
||||||
import definePlugin, { OptionType, ReporterTestable } from "@utils/types";
|
import definePlugin, { OptionType, ReporterTestable } from "@utils/types";
|
||||||
import { filters, findAll, search, wreq } from "@webpack";
|
import { CodeFilter, filters, findAll, search, stringMatches, wreq } from "@webpack";
|
||||||
|
|
||||||
const PORT = 8485;
|
const PORT = 8485;
|
||||||
const NAV_ID = "dev-companion-reconnect";
|
const NAV_ID = "dev-companion-reconnect";
|
||||||
|
@ -87,13 +87,7 @@ function parseNode(node: Node) {
|
||||||
throw new Error("Unknown Node Type " + (node as any).type);
|
throw new Error("Unknown Node Type " + (node as any).type);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
type CodeFilter = Array<string | RegExp>;
|
// we need to have our own because the one in webpack returns the first with no handling of more than one module
|
||||||
const stringMatches = (s: string, filter: CodeFilter) =>
|
|
||||||
filter.every(f =>
|
|
||||||
typeof f === "string"
|
|
||||||
? s.includes(f)
|
|
||||||
: f.test(s)
|
|
||||||
);
|
|
||||||
function findModuleId(find: CodeFilter) {
|
function findModuleId(find: CodeFilter) {
|
||||||
const matches: string[] = [];
|
const matches: string[] = [];
|
||||||
for (const id in wreq.m) {
|
for (const id in wreq.m) {
|
||||||
|
|
Loading…
Reference in a new issue