mirror of
https://github.com/tribufu/node-gamedig
synced 2026-05-06 15:17:36 +00:00
* Make the QueryRunner more readable * Remove use of deprecated substr and replace with substring, and some formatting
26 lines
525 B
JavaScript
26 lines
525 B
JavaScript
const QueryRunner = require('./QueryRunner');
|
|
|
|
let singleton = null;
|
|
|
|
class Gamedig {
|
|
constructor(runnerOpts) {
|
|
this.queryRunner = new QueryRunner(runnerOpts);
|
|
}
|
|
|
|
async query(userOptions) {
|
|
return await this.queryRunner.run(userOptions);
|
|
}
|
|
|
|
static getInstance() {
|
|
if (!singleton)
|
|
singleton = new Gamedig();
|
|
|
|
return singleton;
|
|
}
|
|
|
|
static async query(...args) {
|
|
return await Gamedig.getInstance().query(...args);
|
|
}
|
|
}
|
|
|
|
module.exports = Gamedig;
|