Skip to content

Commit

Permalink
chore: Format with new prettier version.
Browse files Browse the repository at this point in the history
  • Loading branch information
iphydf committed Feb 27, 2024
1 parent 673ec31 commit ff4208f
Show file tree
Hide file tree
Showing 10 changed files with 131 additions and 114 deletions.
5 changes: 5 additions & 0 deletions .restyled.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
restylers:
- prettier:
arguments: ["--print-width=100"]
- "*"
4 changes: 2 additions & 2 deletions examples/bin/file-transfer-example.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ var nodes = [
nodes.forEach(function (node) {
tox.bootstrapSync(node.address, node.port, node.key);
console.log(
"Successfully bootstrapped from " + node.maintainer + " at " + node.address + ":" + node.port
"Successfully bootstrapped from " + node.maintainer + " at " + node.address + ":" + node.port,
);
console.log("... with key " + node.key);
});
Expand Down Expand Up @@ -134,7 +134,7 @@ tox.on("fileChunkRequest", function (e) {
"Sending chunk (friend=%d, position=%d, size=%d)",
e.friend(),
e.position(),
data.length
data.length,
);
tox.sendFileChunkSync(e.friend(), e.file(), e.position(), data);
//console.log('DONE (2)');
Expand Down
2 changes: 1 addition & 1 deletion examples/bin/packet-simulation.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ tx.on("friendLossyPacket", function (e) {
toxName,
node.maintainer,
node.address,
node.port
node.port,
);
console.log("... with key %s", node.key);
});
Expand Down
29 changes: 15 additions & 14 deletions examples/bin/promises-example.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ var bootstrap = function (callback) {
" at " +
node.address +
":" +
node.port
node.port,
);
console.log("... with key " + node.key);
cb();
Expand Down Expand Up @@ -126,18 +126,19 @@ var initCallbacks = function (callback) {
getStatus = tox.getFriendStatusAsync(e.friend()),
getConnectionStatus = tox.getFriendConnectionStatusAsync(e.friend());

Promise.join(getName, getStatusMessage, getStatus, getConnectionStatus, function (
name,
statusMessage,
status,
connectionStatus
) {
console.log("Friend " + e.friend() + " profile:");
console.log(" Name: " + name);
console.log(" Status message: " + statusMessage);
console.log(" Status: " + status);
console.log(" Connection status: " + connectionStatus);
});
Promise.join(
getName,
getStatusMessage,
getStatus,
getConnectionStatus,
function (name, statusMessage, status, connectionStatus) {
console.log("Friend " + e.friend() + " profile:");
console.log(" Name: " + name);
console.log(" Status message: " + statusMessage);
console.log(" Status: " + status);
console.log(" Connection status: " + connectionStatus);
},
);
}

if (e.message() === "lastonline") {
Expand Down Expand Up @@ -172,5 +173,5 @@ async.parallel(
console.log("Address: " + address);
tox.start(); // Start
});
}
},
);
4 changes: 2 additions & 2 deletions examples/bin/sync-example.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ var nodes = [
nodes.forEach(function (node) {
tox.bootstrapSync(node.address, node.port, node.key);
console.log(
"Successfully bootstrapped from " + node.maintainer + " at " + node.address + ":" + node.port
"Successfully bootstrapped from " + node.maintainer + " at " + node.address + ":" + node.port,
);
console.log("... with key " + node.key);
});
Expand Down Expand Up @@ -66,7 +66,7 @@ tox.on("friendConnectionStatus", function (e) {
"] is now " +
(e.isConnected() ? "online" : "offline") +
": " +
statusMessage
statusMessage,
);
});

Expand Down
2 changes: 1 addition & 1 deletion lib/errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ module.exports = {
return new ToxError(
"TOX_FUNC_RETURNED_UNSUCCESSFUL",
0,
"api function returned unsuccessful, but error value indicates success"
"api function returned unsuccessful, but error value indicates success",
);
},
};
Loading

0 comments on commit ff4208f

Please sign in to comment.