Skip to content

Commit 4db0ca7

Browse files
authored
Bugfix/schiltz3/deepsource2 (#94)
# Deepsource fixes 2 Fix several more instances of using `==` rather than `===` moves the ignored comment to the (hopefully) correct line. # Changes * Replace `==` with `===` * put ignore comment on the correct line * rename lambda variables to not shadow function variables
2 parents 6c10137 + cfb8b86 commit 4db0ca7

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

commands/owner/csCreateChannels.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,9 @@ export default {
9393
const children = Array.from(cs_category.children.values());
9494
for (let index = 0; index < children.length; index++) {
9595
const match = cleaned_courses.find((course) => {
96-
return course == children[index].name;
96+
return course === children[index].name;
9797
});
98-
if (match != undefined) {
98+
if (match !== undefined) {
9999
continue;
100100
}
101101
console.log(`Moving: ${children[index]} to: ${cs_past_category_name}`);
@@ -165,7 +165,7 @@ export default {
165165
// Ping members who have this role
166166
const found_role = msgInt.guild.roles.cache.find((role) => {
167167
return (
168-
cleanRoleString(role.name) ==
168+
cleanRoleString(role.name) ===
169169
cleanChannelString(courses[index].CODE)
170170
);
171171
});
@@ -198,7 +198,7 @@ export default {
198198
// Ping members who have this role
199199
const found_role = msgInt.guild.roles.cache.find((role) => {
200200
return (
201-
cleanRoleString(role.name) ==
201+
cleanRoleString(role.name) ===
202202
cleanChannelString(courses[index].CODE)
203203
);
204204
});

index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,9 @@ client.on("ready", async () => {
3737
console.log("Checking if all roles exist in servers.");
3838

3939
await Promise.all(
40+
// skipcq JS-0042
4041
client.guilds.cache.map((guild) => {
41-
checkForRoles(guild); // skipcq JS-0042
42+
checkForRoles(guild);
4243
})
4344
);
4445
}

utils/channels.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export function cleanChannelString(s: string): string {
1111

1212
export function checkForChannel(guild: Guild, channel_name: string) {
1313
return guild.channels.cache.find((channel) => {
14-
return channel.name == channel_name;
14+
return channel.name === channel_name;
1515
});
1616
}
1717

0 commit comments

Comments
 (0)