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