this repo has no description
1import spacepack from "@moonlight-mod/wp/spacepack_spacepack";
2
3// spacepack.require.m[moonlight.moonmap.modules["discord/modules/menus/web/Menu"]].toString();
4let code =
5 spacepack.require.m[
6 spacepack.findByCode("Menu API only allows Items and groups of Items as children.")[0].id
7 ].toString();
8
9const parserSym = code.match(/(?<=_patchMenu\(.,).+?(?=\()/)![0];
10
11code = code.replace(/{(.):\(\)=>./, (orig, e) => `{${e}:()=>${parserSym}`);
12const mod = new Function("module", "exports", "require", `(${code}).apply(this, arguments)`);
13
14const exp: any = {};
15mod({}, exp, require);
16
17const parser = spacepack.findFunctionByStrings(exp, "Menu API only allows Items and groups of Items as children.")!;
18module.exports = parser;