Remove usage of == and !=
This commit is contained in:
parent
205a617c51
commit
b67cd10c64
21 changed files with 79 additions and 78 deletions
26
lib/irc.js
26
lib/irc.js
|
@ -120,7 +120,7 @@ export function parseTags(s) {
|
|||
let parts = s.split("=", 2);
|
||||
let k = parts[0];
|
||||
let v = null;
|
||||
if (parts.length == 2) {
|
||||
if (parts.length === 2) {
|
||||
v = unescapeTag(parts[1]);
|
||||
if (v.endsWith("\\")) {
|
||||
v = v.slice(0, v.length - 1);
|
||||
|
@ -315,13 +315,13 @@ function isURIPrefix(text) {
|
|||
}
|
||||
|
||||
export function isHighlight(msg, nick, cm) {
|
||||
if (msg.command != "PRIVMSG" && msg.command != "NOTICE") {
|
||||
if (msg.command !== "PRIVMSG" && msg.command !== "NOTICE") {
|
||||
return false;
|
||||
}
|
||||
|
||||
nick = cm(nick);
|
||||
|
||||
if (msg.prefix && cm(msg.prefix.name) == nick) {
|
||||
if (msg.prefix && cm(msg.prefix.name) === nick) {
|
||||
return false; // Our own messages aren't highlights
|
||||
}
|
||||
|
||||
|
@ -349,7 +349,7 @@ export function isHighlight(msg, nick, cm) {
|
|||
}
|
||||
|
||||
export function isServerBroadcast(msg) {
|
||||
if (msg.command != "PRIVMSG" && msg.command != "NOTICE") {
|
||||
if (msg.command !== "PRIVMSG" && msg.command !== "NOTICE") {
|
||||
return false;
|
||||
}
|
||||
return msg.params[0].startsWith("$");
|
||||
|
@ -387,7 +387,7 @@ export function formatDate(date) {
|
|||
}
|
||||
|
||||
export function parseCTCP(msg) {
|
||||
if (msg.command != "PRIVMSG" && msg.command != "NOTICE") {
|
||||
if (msg.command !== "PRIVMSG" && msg.command !== "NOTICE") {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -507,7 +507,7 @@ export class Isupport {
|
|||
return stdChanModes;
|
||||
}
|
||||
let chanModes = this.raw.get("CHANMODES").split(",");
|
||||
if (chanModes.length != 4) {
|
||||
if (chanModes.length !== 4) {
|
||||
console.error("Invalid CHANMODES: ", this.raw.get("CHANMODES"));
|
||||
return stdChanModes;
|
||||
}
|
||||
|
@ -572,13 +572,13 @@ export const CaseMapping = {
|
|||
let ch = str[i];
|
||||
if ("A" <= ch && ch <= "Z") {
|
||||
ch = ch.toLowerCase();
|
||||
} else if (ch == "{") {
|
||||
} else if (ch === "{") {
|
||||
ch = "[";
|
||||
} else if (ch == "}") {
|
||||
} else if (ch === "}") {
|
||||
ch = "]";
|
||||
} else if (ch == "\\") {
|
||||
} else if (ch === "\\") {
|
||||
ch = "|";
|
||||
} else if (ch == "~") {
|
||||
} else if (ch === "~") {
|
||||
ch = "^";
|
||||
}
|
||||
out += ch;
|
||||
|
@ -592,11 +592,11 @@ export const CaseMapping = {
|
|||
let ch = str[i];
|
||||
if ("A" <= ch && ch <= "Z") {
|
||||
ch = ch.toLowerCase();
|
||||
} else if (ch == "{") {
|
||||
} else if (ch === "{") {
|
||||
ch = "[";
|
||||
} else if (ch == "}") {
|
||||
} else if (ch === "}") {
|
||||
ch = "]";
|
||||
} else if (ch == "\\") {
|
||||
} else if (ch === "\\") {
|
||||
ch = "|";
|
||||
}
|
||||
out += ch;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue