1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-06-27 23:28:38 +02:00

Applied prettier to code base

This commit is contained in:
Laurent Cozic
2018-03-09 17:49:35 +00:00
parent e868102c98
commit c4f19465a6
203 changed files with 13395 additions and 7927 deletions

View File

@ -1,19 +1,19 @@
const { shim } = require('lib/shim.js');
const { shim } = require("lib/shim.js");
const netUtils = {};
netUtils.ip = async () => {
let response = await shim.fetch('https://api.ipify.org/?format=json');
let response = await shim.fetch("https://api.ipify.org/?format=json");
if (!response.ok) {
throw new Error('Could not retrieve IP: ' + await response.text());
throw new Error("Could not retrieve IP: " + (await response.text()));
}
let ip = await response.json();
return ip.ip;
}
};
netUtils.findAvailablePort = async (possiblePorts, extraRandomPortsToTry = 20) => {
const tcpPortUsed = require('tcp-port-used');
const tcpPortUsed = require("tcp-port-used");
for (let i = 0; i < extraRandomPortsToTry; i++) {
possiblePorts.push(Math.floor(8000 + Math.random() * 2000));
@ -28,6 +28,6 @@ netUtils.findAvailablePort = async (possiblePorts, extraRandomPortsToTry = 20) =
}
}
return port;
}
};
module.exports = { netUtils };
module.exports = { netUtils };