chore: replace instances of find(x => x = ...)
with indexOf(...)
This commit is contained in:
parent
870ff2dd2c
commit
b01376f703
@ -340,7 +340,7 @@ export const getInventoryResponse = async (
|
||||
};
|
||||
|
||||
const addString = (arr: string[], str: string): void => {
|
||||
if (!arr.find(x => x == str)) {
|
||||
if (arr.indexOf(str) == -1) {
|
||||
arr.push(str);
|
||||
}
|
||||
};
|
||||
|
@ -26,7 +26,7 @@ export const loginRewardsSelectionController: RequestHandler = async (req, res)
|
||||
StoreItemType: body.ChosenReward
|
||||
};
|
||||
inventoryChanges = (await handleStoreItemAcquisition(body.ChosenReward, inventory)).InventoryChanges;
|
||||
if (!evergreenRewards.find(x => x == body.ChosenReward)) {
|
||||
if (evergreenRewards.indexOf(body.ChosenReward) == -1) {
|
||||
inventory.LoginMilestoneRewards.push(body.ChosenReward);
|
||||
}
|
||||
} else {
|
||||
|
@ -177,7 +177,7 @@ export const nemesisController: RequestHandler = async (req, res) => {
|
||||
weaponIdx = initialWeaponIdx;
|
||||
do {
|
||||
const weapon = weapons[weaponIdx];
|
||||
if (!body.target.DisallowedWeapons.find(x => x == weapon)) {
|
||||
if (body.target.DisallowedWeapons.indexOf(weapon) == -1) {
|
||||
break;
|
||||
}
|
||||
weaponIdx = (weaponIdx + 1) % weapons.length;
|
||||
|
@ -445,7 +445,7 @@ export const addGuildMemberShipDecoContribution = (guildMember: IGuildMemberData
|
||||
export const processDojoBuildMaterialsGathered = (guild: TGuildDatabaseDocument, build: IDojoBuild): void => {
|
||||
if (build.guildXpValue) {
|
||||
guild.ClaimedXP ??= [];
|
||||
if (!guild.ClaimedXP.find(x => x == build.resultType)) {
|
||||
if (guild.ClaimedXP.indexOf(build.resultType) == -1) {
|
||||
guild.ClaimedXP.push(build.resultType);
|
||||
guild.XP += build.guildXpValue;
|
||||
}
|
||||
|
@ -90,7 +90,7 @@ export const getAccountIdForRequest = async (req: Request): Promise<string> => {
|
||||
};
|
||||
|
||||
export const isAdministrator = (account: TAccountDocument): boolean => {
|
||||
return !!config.administratorNames?.find(x => x == account.DisplayName);
|
||||
return config.administratorNames?.indexOf(account.DisplayName) != -1;
|
||||
};
|
||||
|
||||
const platform_magics = [753, 639, 247, 37, 60];
|
||||
|
@ -383,7 +383,7 @@ export const addMissionInventoryUpdates = async (
|
||||
}
|
||||
if (
|
||||
inventory.LibraryActiveDailyTaskInfo &&
|
||||
inventory.LibraryActiveDailyTaskInfo.EnemyTypes.find(x => x == scan.EnemyType)
|
||||
inventory.LibraryActiveDailyTaskInfo.EnemyTypes.indexOf(scan.EnemyType) != -1
|
||||
) {
|
||||
inventory.LibraryActiveDailyTaskInfo.Scans ??= 0;
|
||||
inventory.LibraryActiveDailyTaskInfo.Scans += scan.Count;
|
||||
|
Loading…
x
Reference in New Issue
Block a user