fix no arguments for both cli and direct

This commit is contained in:
Pigges 2023-10-09 21:08:48 +02:00
parent eabaa68da2
commit b060572ec5
2 changed files with 3 additions and 3 deletions

View file

@ -74,9 +74,9 @@ export default class Cli {
cmd = (await input("Send command: ")).split(' ');
const method = cmd[0];
const params = cmd.length > 1 ? cmd.shift() && cmd : "";
const params = cmd.length > 1 ? cmd.shift() && cmd : [];
console.log(await this.client.sendRequest(method, params || []));
console.log(await this.client.sendRequest(method, params));
}
}

View file

@ -19,7 +19,7 @@ async function main() {
const method = cmd[0];
const params = cmd.length > 1 ? cmd.shift() && cmd : "";
const params = cmd.length > 1 ? cmd.shift() && cmd : [];
const client = new Client(false);
await client.connect([server[0], parseInt(server[1])]);