chore: simplify arguments defaulted to undefined
This commit is contained in:
parent
90e97d7888
commit
c7c416c100
@ -134,7 +134,7 @@ export const getGuildVault = (guild: TGuildDatabaseDocument): IGuildVault => {
|
|||||||
export const getDojoClient = async (
|
export const getDojoClient = async (
|
||||||
guild: TGuildDatabaseDocument,
|
guild: TGuildDatabaseDocument,
|
||||||
status: number,
|
status: number,
|
||||||
componentId: Types.ObjectId | string | undefined = undefined
|
componentId?: Types.ObjectId | string
|
||||||
): Promise<IDojoClient> => {
|
): Promise<IDojoClient> => {
|
||||||
const dojo: IDojoClient = {
|
const dojo: IDojoClient = {
|
||||||
_id: { $oid: guild._id.toString() },
|
_id: { $oid: guild._id.toString() },
|
||||||
@ -554,7 +554,7 @@ export const setGuildTechLogState = (
|
|||||||
guild: TGuildDatabaseDocument,
|
guild: TGuildDatabaseDocument,
|
||||||
type: string,
|
type: string,
|
||||||
state: number,
|
state: number,
|
||||||
dateTime: Date | undefined = undefined
|
dateTime?: Date
|
||||||
): boolean => {
|
): boolean => {
|
||||||
guild.TechChanges ??= [];
|
guild.TechChanges ??= [];
|
||||||
const entry = guild.TechChanges.find(x => x.details == type);
|
const entry = guild.TechChanges.find(x => x.details == type);
|
||||||
|
@ -143,7 +143,7 @@ const awakeningRewards = [
|
|||||||
|
|
||||||
export const addStartingGear = async (
|
export const addStartingGear = async (
|
||||||
inventory: TInventoryDatabaseDocument,
|
inventory: TInventoryDatabaseDocument,
|
||||||
startingGear: TPartialStartingGear | undefined = undefined
|
startingGear?: TPartialStartingGear
|
||||||
): Promise<IInventoryChanges> => {
|
): Promise<IInventoryChanges> => {
|
||||||
const { LongGuns, Pistols, Suits, Melee } = startingGear || {
|
const { LongGuns, Pistols, Suits, Melee } = startingGear || {
|
||||||
LongGuns: [{ ItemType: "/Lotus/Weapons/Tenno/Rifle/Rifle" }],
|
LongGuns: [{ ItemType: "/Lotus/Weapons/Tenno/Rifle/Rifle" }],
|
||||||
@ -245,7 +245,7 @@ export const combineInventoryChanges = (InventoryChanges: IInventoryChanges, del
|
|||||||
|
|
||||||
export const getInventory = async (
|
export const getInventory = async (
|
||||||
accountOwnerId: string,
|
accountOwnerId: string,
|
||||||
projection: string | undefined = undefined
|
projection?: string
|
||||||
): Promise<TInventoryDatabaseDocument> => {
|
): Promise<TInventoryDatabaseDocument> => {
|
||||||
const inventory = await Inventory.findOne({ accountOwnerId: accountOwnerId }, projection);
|
const inventory = await Inventory.findOne({ accountOwnerId: accountOwnerId }, projection);
|
||||||
|
|
||||||
@ -856,7 +856,7 @@ export const addPowerSuit = async (
|
|||||||
inventory: TInventoryDatabaseDocument,
|
inventory: TInventoryDatabaseDocument,
|
||||||
powersuitName: string,
|
powersuitName: string,
|
||||||
inventoryChanges: IInventoryChanges = {},
|
inventoryChanges: IInventoryChanges = {},
|
||||||
features: number | undefined = undefined
|
features?: number
|
||||||
): Promise<IInventoryChanges> => {
|
): Promise<IInventoryChanges> => {
|
||||||
const powersuit = ExportWarframes[powersuitName] as IPowersuit | undefined;
|
const powersuit = ExportWarframes[powersuitName] as IPowersuit | undefined;
|
||||||
const exalted = powersuit?.exalted ?? [];
|
const exalted = powersuit?.exalted ?? [];
|
||||||
@ -888,7 +888,7 @@ export const addMechSuit = async (
|
|||||||
inventory: TInventoryDatabaseDocument,
|
inventory: TInventoryDatabaseDocument,
|
||||||
mechsuitName: string,
|
mechsuitName: string,
|
||||||
inventoryChanges: IInventoryChanges = {},
|
inventoryChanges: IInventoryChanges = {},
|
||||||
features: number | undefined = undefined
|
features?: number
|
||||||
): Promise<IInventoryChanges> => {
|
): Promise<IInventoryChanges> => {
|
||||||
const powersuit = ExportWarframes[mechsuitName] as IPowersuit | undefined;
|
const powersuit = ExportWarframes[mechsuitName] as IPowersuit | undefined;
|
||||||
const exalted = powersuit?.exalted ?? [];
|
const exalted = powersuit?.exalted ?? [];
|
||||||
@ -940,7 +940,7 @@ export const addSpaceSuit = (
|
|||||||
inventory: TInventoryDatabaseDocument,
|
inventory: TInventoryDatabaseDocument,
|
||||||
spacesuitName: string,
|
spacesuitName: string,
|
||||||
inventoryChanges: IInventoryChanges = {},
|
inventoryChanges: IInventoryChanges = {},
|
||||||
features: number | undefined = undefined
|
features?: number
|
||||||
): IInventoryChanges => {
|
): IInventoryChanges => {
|
||||||
const suitIndex =
|
const suitIndex =
|
||||||
inventory.SpaceSuits.push({
|
inventory.SpaceSuits.push({
|
||||||
@ -1199,9 +1199,9 @@ export const addEquipment = (
|
|||||||
inventory: TInventoryDatabaseDocument,
|
inventory: TInventoryDatabaseDocument,
|
||||||
category: TEquipmentKey,
|
category: TEquipmentKey,
|
||||||
type: string,
|
type: string,
|
||||||
modularParts: string[] | undefined = undefined,
|
modularParts?: string[],
|
||||||
inventoryChanges: IInventoryChanges = {},
|
inventoryChanges: IInventoryChanges = {},
|
||||||
defaultOverwrites: Partial<IEquipmentDatabase> | undefined = undefined
|
defaultOverwrites?: Partial<IEquipmentDatabase>
|
||||||
): IInventoryChanges => {
|
): IInventoryChanges => {
|
||||||
const equipment = Object.assign(
|
const equipment = Object.assign(
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user