mirror of
https://github.com/tribufu/node-gamedig
synced 2026-05-06 07:07:33 +00:00
Convert tabs to spaces
This commit is contained in:
parent
0dd25bfcda
commit
3674d384d0
39 changed files with 2414 additions and 2414 deletions
|
|
@ -11,27 +11,27 @@ delete argv.output;
|
|||
const options = {};
|
||||
for(const key of Object.keys(argv)) {
|
||||
const value = argv[key];
|
||||
if(
|
||||
key === '_'
|
||||
|| key.charAt(0) === '$'
|
||||
|| (typeof value !== 'string' && typeof value !== 'number')
|
||||
)
|
||||
continue;
|
||||
options[key] = value;
|
||||
if(
|
||||
key === '_'
|
||||
|| key.charAt(0) === '$'
|
||||
|| (typeof value !== 'string' && typeof value !== 'number')
|
||||
)
|
||||
continue;
|
||||
options[key] = value;
|
||||
}
|
||||
|
||||
if(debug) Gamedig.debug = true;
|
||||
Gamedig.isCommandLine = true;
|
||||
|
||||
Gamedig.query(options)
|
||||
.then((state) => {
|
||||
if(outputFormat === 'pretty') {
|
||||
console.log(JSON.stringify(state,null,' '));
|
||||
} else {
|
||||
console.log(JSON.stringify(state));
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
.then((state) => {
|
||||
if(outputFormat === 'pretty') {
|
||||
console.log(JSON.stringify(state,null,' '));
|
||||
} else {
|
||||
console.log(JSON.stringify(state));
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
if (debug) {
|
||||
if (error instanceof Error) {
|
||||
console.log(error.stack);
|
||||
|
|
@ -48,4 +48,4 @@ Gamedig.query(options)
|
|||
console.log(JSON.stringify({error: error}));
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue