Skip to content

Commit

Permalink
lib: change multiline function signatures style
Browse files Browse the repository at this point in the history
Make multiline function signatures more concise and readable.
  • Loading branch information
aqrln committed Mar 3, 2017
1 parent f6f0aba commit d50dc85
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 30 deletions.
7 changes: 1 addition & 6 deletions lib/applications.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +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) {
return callback(errors.ERR_INTERFACE_NOT_FOUND);
Expand Down
13 changes: 2 additions & 11 deletions lib/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +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) {
return callback(error);
Expand All @@ -107,12 +103,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) => {
if (error) {
Expand Down
16 changes: 3 additions & 13 deletions lib/connection.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +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];
this._callbacks[packetId] = callback || common.doNothing;
Expand Down Expand Up @@ -110,10 +106,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);
};
Expand Down Expand Up @@ -593,10 +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);
};

Expand Down

0 comments on commit d50dc85

Please sign in to comment.