Skip to content

Commit

Permalink
Fix sample file
Browse files Browse the repository at this point in the history
  • Loading branch information
Davilarek committed Feb 22, 2024
1 parent 159d03c commit 553c150
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions test/sample/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import { WebpackApi } from "discord-mod-compiler";

function start() {
const getModuleType1 = WebpackApi.getModule;
const someModuleType1 = getModule(x => x._sendMessage);
const someModuleType1 = getModuleType1(x => x._sendMessage);

const { getModule: getModuleType2 } = WebpackApi;
const someModuleType2 = getModuleType2(x => x._sendMessage);

const someModuleType3 = WebpackApi.getModule(x => x._sendMessage);

const modules = [
Expand All @@ -17,9 +17,15 @@ function start() {
someModuleType3
]

if (modules.any(x => x === undefined)) {
if (modules.some(x => x === undefined)) {
throw new Error("WebpackApi.getModule is not working");
} else {
console.log("WebpackApi.getModule is working");
}
}

function stop() {

}

export { start, stop };

0 comments on commit 553c150

Please sign in to comment.