diff --git a/src/Cli.js b/src/Cli.js index 5b101d3..e315e97 100644 --- a/src/Cli.js +++ b/src/Cli.js @@ -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)); } } diff --git a/src/index.js b/src/index.js index 482ffaf..1f107fe 100644 --- a/src/index.js +++ b/src/index.js @@ -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])]);