Skip to content

Commit

Permalink
chore: run lint
Browse files Browse the repository at this point in the history
  • Loading branch information
gregfrasco committed Mar 8, 2024
1 parent ad107c7 commit e22eeb6
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion demos/standard-deviation/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ function computeResults(inputs) {
results.push(truncate(diff.sqrt()));
}

assert.deepEqual(results[0].toString(10), "0");
assert.deepEqual(results[0].toString(10), '0');
return results;
}

Expand Down
4 changes: 2 additions & 2 deletions lib/ext/jiff-client-websockets.js
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,8 @@
function guardedSocket(jiffClient) {
// Create plain socket io object which we will wrap in this
var socket;
if (jiffClient.hostname.startsWith("http")) {
var modifiedHostName = "ws" + jiffClient.hostname.substring(jiffClient.hostname.indexOf(":"))
if (jiffClient.hostname.startsWith('http')) {
var modifiedHostName = 'ws' + jiffClient.hostname.substring(jiffClient.hostname.indexOf(':'))
socket = new ws(modifiedHostName)
} else {
socket = new ws(jiffClient.hostname);
Expand Down
10 changes: 5 additions & 5 deletions lib/ext/jiff-server-websockets.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* This defines a library extension for using websockets rather than socket.io for communication. This
* extension primarily edits/overwrites existing socket functions to use and be compatible with the
* extension primarily edits/overwrites existing socket functions to use and be compatible with the
* ws library.
* @namespace jiffserver_websockets
* @version 1.0
Expand Down Expand Up @@ -31,7 +31,7 @@ var $ = require('jquery-deferred');
options = {};
}

/* socketMaps now stores a reference directly to a socket rather than a socketId
/* socketMaps now stores a reference directly to a socket rather than a socketId
To avoid naming confusion, this is still referred to as socketId
*/
jiff.socketMaps = {
Expand Down Expand Up @@ -195,7 +195,7 @@ var $ = require('jquery-deferred');

if (jiff.computationMaps.freeParties[computation_id] == null || jiff.computationMaps.freeParties[computation_id][from_id]) {
delete jiff.socketMaps.computationId[socket.id];
delete jiff.socketMaps.partyId[socket.id];
delete jiff.socketMaps.partyId[socket.id];
} else {
socket.__jiff_cleaned = true;
}
Expand Down Expand Up @@ -261,7 +261,7 @@ var $ = require('jquery-deferred');
free(msg.data, callback);
break;
default:
console.log("Unknown protocol received");
console.log('Unknown protocol received');
}
});

Expand Down Expand Up @@ -309,7 +309,7 @@ var $ = require('jquery-deferred');



/** Make sure that our socket is closed in case one was created
/** Make sure that our socket is closed in case one was created
* before the exension was able to execute. Then, open the server
* for connections to clients.
*/
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
"test-demo": "./demos/run-test.sh",
"fix-memory-limit": "cross-env LIMIT=4096 increase-memory-limit",
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"tutorial": "npm install && cd tutorials && node index.js",
"build": "browserify lib/jiff-client.js --debug -s JIFFClient -o dist/jiff-client.js && browserify lib/ext/jiff-client-websockets.js --debug -s jiff_websockets -o dist/jiff-client-websockets.js"
},
Expand Down

0 comments on commit e22eeb6

Please sign in to comment.