From bb86faa060236d2a056f2afb52bccf5221a5881e Mon Sep 17 00:00:00 2001 From: Alexey Orlenko Date: Fri, 3 Mar 2017 17:05:46 +0200 Subject: [PATCH] lib: change multiline function signatures style Make multiline function signatures more concise. PR-URL: https://github.com/metarhia/JSTP/pull/97 --- lib/applications.js | 6 +----- lib/client.js | 11 ++--------- lib/connection.js | 13 +++---------- 3 files changed, 6 insertions(+), 24 deletions(-) diff --git a/lib/applications.js b/lib/applications.js index ff0b2bc8..0b24d491 100644 --- a/lib/applications.js +++ b/lib/applications.js @@ -25,11 +25,7 @@ apps.Application = Application; // callback - method callback // Application.prototype.callMethod = function( - connection, - interfaceName, - methodName, - args, - callback + connection, interfaceName, methodName, args, callback ) { const appInterface = this.api[interfaceName]; if (!appInterface) { diff --git a/lib/client.js b/lib/client.js index d4533610..83236d98 100644 --- a/lib/client.js +++ b/lib/client.js @@ -76,10 +76,7 @@ Client.prototype.disconnect = function(callback) { // callback - callback function with signature (error, connection, sessionId) // Client.prototype.connectAndHandshake = function( - appName, - username, - password, - callback + appName, username, password, callback ) { this.connect((error, connection) => { if (error) { @@ -107,11 +104,7 @@ Client.prototype.connectAndHandshake = function( // (error, connection, sessionId, api) // Client.prototype.connectAndInspect = function( - appName, - username, - password, - interfaces, - callback + appName, username, password, interfaces, callback ) { this.connectAndHandshake( appName, username, password, (error, connection, sid) => { diff --git a/lib/connection.js b/lib/connection.js index 61e8d03e..4095053d 100644 --- a/lib/connection.js +++ b/lib/connection.js @@ -73,10 +73,7 @@ util.inherits(Connection, events.EventEmitter); // has been received // Connection.prototype.callMethod = function( - interfaceName, - methodName, - args, - callback + interfaceName, methodName, args, callback ) { const packet = this.createPacket('call', interfaceName, methodName, args); const packetId = packet.call[0]; @@ -110,9 +107,7 @@ Connection.prototype.callback = function(packetId, error, result) { // args - event arguments as an object // Connection.prototype.emitRemoteEvent = function( - interfaceName, - eventName, - args + interfaceName, eventName, args ) { const packet = this.createPacket('event', interfaceName, eventName, args); this._send(packet); @@ -591,9 +586,7 @@ Connection.prototype._processPongPacket = function(packet) { // result - data to send back as a result // Connection.prototype._remoteCallbackWrapper = function( - packetId, - error, - ...result + packetId, error, ...result ) { this.callback(packetId, error, result); };