this repo has no description
1import spacepack from "@moonlight-mod/wp/spacepack_spacepack";
2
3let code =
4 spacepack.require.m[
5 spacepack.findByCode(
6 "Menu API only allows Items and groups of Items as children."
7 )[0].id
8 ].toString();
9code = code.replace(/,.=(?=function .\(.\){.+?,.=function)/, ";return ");
10code = code.replace(/,(?=__contextMenu)/, ";let ");
11const mod = new Function(
12 "module",
13 "exports",
14 "require",
15 `(${code}).apply(this, arguments)`
16);
17const exp: any = {};
18mod({}, exp, require);
19const Menu = spacepack.findFunctionByStrings(
20 exp,
21 "Menu API only allows Items and groups of Items as children."
22)!;
23module.exports = (el: any) => {
24 return Menu({
25 children: el,
26 __contextMenu_evilMenu: true
27 });
28};