( memberships: ReadonlyArray<SeatMembership>, pendingInvitationCount: number, )
| 95 | * both lists, so take the larger of the two rather than adding them. |
| 96 | */ |
| 97 | export const countSeatsUsed = ( |
| 98 | memberships: ReadonlyArray<SeatMembership>, |
| 99 | pendingInvitationCount: number, |
| 100 | ): number => { |
| 101 | const active = memberships.filter((m) => m.status === "active").length; |
| 102 | const pendingMembers = memberships.filter((m) => m.status === "pending").length; |
| 103 | return active + Math.max(pendingMembers, pendingInvitationCount); |
| 104 | }; |
no outgoing calls
no test coverage detected