refactor: compatible commonjs loader

Signed-off-by: MiaoWoo <admin@yumc.pw>
This commit is contained in:
2019-04-23 18:44:15 +08:00
parent a875a6ca8e
commit 93d7389047
71 changed files with 78 additions and 86 deletions

16
src/main/resources/node_modules/api/server.js generated vendored Normal file
View File

@ -0,0 +1,16 @@
/*global Java, base, module, exports, require*/
function ServerHandlerDefault() {
/**
* 获取在线玩家
*/
this.players = function () {
switch (arguments.length) {
case 1:
if (toString.call(arguments[0]) !== "[object Function]") { throw TypeError('first argument must be a function!') }
return this.onlinePlayers().forEach(arguments[0]);
default:
return this.onlinePlayers();
}
};
}
exports = module.exports = Object.assign(new ServerHandlerDefault(), requireInternal('server'));