1
1
mirror of https://github.com/Burn-E99/TheArtificer.git synced 2026-06-04 09:03:50 -04:00

Swap indexOf to includes when indexOf was just being used to check if an item was in an array

This commit is contained in:
Ean Milligan
2025-04-27 04:15:04 -04:00
parent 2e2e08f48a
commit 73e4ca94b7
7 changed files with 14 additions and 14 deletions

View File

@@ -11,7 +11,7 @@ export const apiChannelManageActive = async (query: Map<string, string>, apiUser
erroredOut = false;
// Determine value to set
if (path.toLowerCase().indexOf('de') > 0) {
if (path.toLowerCase().includes('de')) {
value = 0;
} else {
value = 1;

View File

@@ -12,7 +12,7 @@ export const apiChannelManageBan = async (query: Map<string, string>, apiUserid:
erroredOut = false;
// Determine value to set
if (path.toLowerCase().indexOf('un') > 0) {
if (path.toLowerCase().includes('un')) {
value = 0;
} else {
value = 1;

View File

@@ -13,14 +13,14 @@ export const apiKeyManage = async (query: Map<string, string>, apiUserid: bigint
erroredOut = false;
// Determine key to edit
if (path.toLowerCase().indexOf('ban') > 0) {
if (path.toLowerCase().includes('ban')) {
key = 'banned';
} else {
key = 'active';
}
// Determine value to set
if (path.toLowerCase().indexOf('de') > 0 || path.toLowerCase().indexOf('un') > 0) {
if (path.toLowerCase().includes('de') || path.toLowerCase().includes('un')) {
value = 0;
} else {
value = 1;