Skip to content

Commit

Permalink
Merge branch 'fix-unswc' of https://github.com/Tharki-God/replugged i…
Browse files Browse the repository at this point in the history
…nto fix-unswc
  • Loading branch information
yofukashino committed Oct 28, 2023
2 parents c510a4c + 9dadb45 commit 52d1838
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/renderer/modules/webpack/patch-load.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ function loadWebpackModules(chunksGlobal: WebpackChunkGlobal): void {
signalReady();
}

// Intercept the webpack chunk global as soon as Discord creates it
// Intervoid he webpack chunk global as soon as Discord creates it

// Because using a timer is bad, thanks Ven
// https://github.com/Vendicated/Vencord/blob/ef353f1d66dbf1d14e528830d267aac518ed1beb/src/webpack/patchWebpack.ts
Expand Down
1 change: 1 addition & 0 deletions src/renderer/modules/webpack/plaintext-patch.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type { PlaintextPatch, RawPlaintextPatch, WebpackModule } from "../../../types";
import { Logger } from "../logger";

const logger = Logger.api("plaintext-patch");
/**
* All plaintext patches
Expand Down
9 changes: 6 additions & 3 deletions src/types/webpack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,17 @@ export type WebpackModule = (
wpRequire: WebpackRequire,
) => void;

export type WebpackChunk = [Array<symbol | number>, Record<number, WebpackModule>];
export type WebpackChunk = [
Array<symbol | number>,
Record<number, WebpackModule>,
((r: WebpackRequire) => unknown)?,
];

// Do NOT put `WebpackChunk[]` first, otherwise TS
// prioritizes Array.prototype.push over this custom
// push method and starts producing errors.
export type WebpackChunkGlobal = {
push(chunk: WebpackChunk): void;
push<T extends (r: WebpackRequire) => unknown>(chunk: [...WebpackChunk, T]): ReturnType<T>;
push(chunk: WebpackChunk): unknown;
} & WebpackChunk[];

export type Filter = (module: RawModule) => boolean | ModuleExports;
Expand Down

0 comments on commit 52d1838

Please sign in to comment.