chore: simplify getExalted
This commit is contained in:
parent
7b894823cc
commit
c6c3e1c005
@ -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);
|
||||||
}
|
}
|
||||||
|
@ -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/";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user