#Need naming/structure recommendations

6 messages · Page 1 of 1 (latest)

vivid carbon
#

Hey, can you provide a code, not a screenshot?

autumn nova
#

Could use something like playerOrPlayerId instead of player argument

#

And fractionOrFractionType

#

Using _fraction for the argument so that you can use fraction for the final object is an option too, but the above route seems better in this instance

zealous portal
#

could use playerResolvable/PlayerResolvable to refer to a player or their id

jovial cargoBOT
#
denis.monastyrskyi#0

Preview:```ts
type Player = {
id: number
fractionMember: {fractionType: string}
}

type Member = {
playerId: number
}

type Fraction = {
type: string
members: Member[]
}
type FractionType = string

const FractionMemberError = {
INVALID_FRACTION: "INVALID_FRACTION",
...```