chore: npm audit fix #579
@ -369,7 +369,7 @@ export const addPowerSuit = async (powersuitName: string, accountId: string): Pr
|
|||||||
const inventory = await getInventory(accountId);
|
const inventory = await getInventory(accountId);
|
||||||
const suitIndex = inventory.Suits.push({ ItemType: powersuitName, Configs: [], UpgradeVer: 101, XP: 0 });
|
const suitIndex = inventory.Suits.push({ ItemType: powersuitName, Configs: [], UpgradeVer: 101, XP: 0 });
|
||||||
const changedInventory = await inventory.save();
|
const changedInventory = await inventory.save();
|
||||||
return changedInventory.Suits[suitIndex - 1].toJSON();
|
return changedInventory.Suits[suitIndex - 1].toJSON() as object as IEquipmentClient;
|
||||||
};
|
};
|
||||||
|
|||||||
|
|
||||||
export const addMechSuit = async (mechsuitName: string, accountId: string) => {
|
export const addMechSuit = async (mechsuitName: string, accountId: string) => {
|
||||||
@ -527,7 +527,7 @@ export const addEquipment = async (
|
|||||||
});
|
});
|
||||||
|
|
||||||
const changedInventory = await inventory.save();
|
const changedInventory = await inventory.save();
|
||||||
return changedInventory[category][index - 1].toJSON();
|
return changedInventory[category][index - 1].toJSON() as object as IEquipmentClient;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const addCustomization = async (customizatonName: string, accountId: string): Promise<IFlavourItem> => {
|
export const addCustomization = async (customizatonName: string, accountId: string): Promise<IFlavourItem> => {
|
||||||
@ -541,7 +541,7 @@ export const addSkin = async (typeName: string, accountId: string): Promise<IWea
|
|||||||
const inventory = await getInventory(accountId);
|
const inventory = await getInventory(accountId);
|
||||||
const index = inventory.WeaponSkins.push({ ItemType: typeName }) - 1;
|
const index = inventory.WeaponSkins.push({ ItemType: typeName }) - 1;
|
||||||
const changedInventory = await inventory.save();
|
const changedInventory = await inventory.save();
|
||||||
return changedInventory.WeaponSkins[index].toJSON();
|
return changedInventory.WeaponSkins[index].toJSON() as object as IWeaponSkinClient;
|
||||||
};
|
};
|
||||||
|
|
||||||
const addGearExpByCategory = (
|
const addGearExpByCategory = (
|
||||||
|
Loading…
x
Reference in New Issue
Block a user
🛠️ Refactor suggestion
Simplify the type assertion chain
The double type assertion
as object as IEquipmentClient
is unnecessarily verbose. SincetoJSON()
already returns an object, you can directly assert toIEquipmentClient
.📝 Committable suggestion
Kill yourself
@Sainan, understood. If there's anything else I can assist you with, please let me know.