chore: simplify getExalted

This commit is contained in:
Sainan 2024-10-17 22:12:28 +02:00
parent 7b894823cc
commit c6c3e1c005
2 changed files with 5 additions and 10 deletions

View File

@ -361,7 +361,7 @@ export const addSentinel = async (sentinelName: string, accountId: string) => {
export const addPowerSuit = async (powersuitName: string, accountId: string): Promise<IEquipmentClient> => { export const addPowerSuit = async (powersuitName: string, accountId: string): Promise<IEquipmentClient> => {
const specialItems = getExalted(powersuitName); const specialItems = getExalted(powersuitName);
if (specialItems != false) { if (specialItems) {
for await (const specialItem of specialItems) { for await (const specialItem of specialItems) {
await addSpecialItem(specialItem, accountId); await addSpecialItem(specialItem, accountId);
} }
@ -374,7 +374,7 @@ export const addPowerSuit = async (powersuitName: string, accountId: string): Pr
export const addMechSuit = async (mechsuitName: string, accountId: string) => { export const addMechSuit = async (mechsuitName: string, accountId: string) => {
const specialItems = getExalted(mechsuitName); const specialItems = getExalted(mechsuitName);
if (specialItems != false) { if (specialItems) {
for await (const specialItem of specialItems) { for await (const specialItem of specialItems) {
await addSpecialItem(specialItem, accountId); await addSpecialItem(specialItem, accountId);
} }

View File

@ -45,16 +45,11 @@ export const getRecipe = (uniqueName: string): IRecipe | undefined => {
return ExportRecipes[uniqueName]; return ExportRecipes[uniqueName];
}; };
export const getExalted = (uniqueName: string) => { export const getExalted = (uniqueName: string): string[] | undefined => {
const suit = getSuitByUniqueName(uniqueName); return getSuitByUniqueName(uniqueName)?.exalted;
if (suit?.exalted !== undefined) {
return suit.exalted;
} else {
return false;
}
}; };
export const getItemCategoryByUniqueName = (uniqueName: string) => { export const getItemCategoryByUniqueName = (uniqueName: string): string => {
//Lotus/Types/Items/MiscItems/PolymerBundle //Lotus/Types/Items/MiscItems/PolymerBundle
let splitWord = "Items/"; let splitWord = "Items/";