Skip to content

Commit

Permalink
spacepack: filter real function
Browse files Browse the repository at this point in the history
  • Loading branch information
lillithkt committed Dec 12, 2023
1 parent 17bda8a commit eaf7d85
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,10 @@ export const spacepack: Spacepack = {

const matchId = matchResult[1];
return webpackRequire.el(matchId).then(() => webpackRequire(matchId));
},

filterReal: (modules: WebpackModule[]) => {
return modules.filter((module) => module.id.toString().match(/^\d+$/));
}
};

Expand Down
7 changes: 6 additions & 1 deletion packages/types/src/coreExtensions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@ import { FluxDefault, Store } from "./discord/common/Flux";
import { CommonComponents as CommonComponents_ } from "./coreExtensions/components";
import { Dispatcher } from "flux";
import React from "react";
import { WebpackModuleFunc, WebpackRequireType } from "./discord";
import {
WebpackModule,
WebpackModuleFunc,
WebpackRequireType
} from "./discord";

export type Spacepack = {
inspect: (module: number | string) => WebpackModuleFunc | null;
Expand All @@ -27,6 +31,7 @@ export type Spacepack = {
find: string | RegExp | (string | RegExp)[],
match: RegExp
) => Promise<any>;
filterReal: (modules: WebpackModule[]) => WebpackModule[];
};

export type NoticeProps = {
Expand Down

0 comments on commit eaf7d85

Please sign in to comment.