refactor: compatible commonjs loader
Signed-off-by: MiaoWoo <admin@yumc.pw>
This commit is contained in:
16
src/main/resources/node_modules/api/server.js
generated
vendored
Normal file
16
src/main/resources/node_modules/api/server.js
generated
vendored
Normal 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'));
|
Reference in New Issue
Block a user