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(); 7code = code.replace(/,.=(?=function .\(.\){.+?,.=function)/, ";return "); 8code = code.replace(/,(?=__contextMenu)/, ";let "); 9const mod = new Function("module", "exports", "require", `(${code}).apply(this, arguments)`); 10const exp: any = {}; 11mod({}, exp, require); 12const Menu = spacepack.findFunctionByStrings(exp, "Menu API only allows Items and groups of Items as children.")!; 13module.exports = (el: any) => { 14 return Menu({ 15 children: el, 16 __contextMenu_evilMenu: true 17 }); 18};