mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-16 07:24:53 +09:00
Use strict equality checking
Remove usage of == and != in favour of === and !==.
This commit is contained in:
1 parent
ee81fbb7f6
commit
a84f2d5eb6
13 files changed
+29
-21
No files matched your search
@@ -55,7 +55,7 @@ async function loadJsonAsMap(filePath) {
|
||||
return new Map(Object.entries(parsed));
|
||||
|
||||
} catch (err) {
|
||||
if (err.code == "ENOENT") {
|
||||
if (err.code === "ENOENT") {
|
||||
// File does not exist, return empty map
|
||||
return new Map();
|
||||
|
||||
@@ -117,7 +117,7 @@ async function loadJsonArrayAsMap(filePath) {
|
||||
return map;
|
||||
|
||||
} catch (err) {
|
||||
if (err.code == "ENOENT") {
|
||||
if (err.code === "ENOENT") {
|
||||
// File does not exist, return empty map
|
||||
return new Map();
|
||||
|
||||
|
||||
@@ -183,7 +183,7 @@ async function generatePassword(length) {
|
||||
|
||||
if (validChar(byte)) {
|
||||
password += String.fromCharCode(byte);
|
||||
if (password.length == length) {
|
||||
if (password.length === length) {
|
||||
return password;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -352,7 +352,7 @@ class WebSocketClientConnector extends WebSocketBaseConnector {
|
||||
}
|
||||
|
||||
let { seq, type, data } = message;
|
||||
if (type == "hello") {
|
||||
if (type === "hello") {
|
||||
console.log(`SOCKET | received hello from master version ${data.version}`);
|
||||
this.emit("hello", data);
|
||||
if (this._sessionToken) {
|
||||
|
||||
@@ -39,7 +39,7 @@ module.exports.isJSON = function(string){
|
||||
} catch (e){
|
||||
return false;
|
||||
}
|
||||
if(typeof x == "object" || typeof string == "object"){
|
||||
if (typeof x === "object" || typeof string === "object"){
|
||||
stringIsJson = true;
|
||||
}
|
||||
return stringIsJson;
|
||||
|
||||
Reference in new issue
Block a user