( memberships: ReadonlyArray<SeatMembership>, pendingInvitationCount: number, )
| 120 | * both lists, so take the larger of the two rather than adding them. |
| 121 | */ |
| 122 | export const countSeatsUsed = ( |
| 123 | memberships: ReadonlyArray<SeatMembership>, |
| 124 | pendingInvitationCount: number, |
| 125 | ): number => { |
| 126 | const active = memberships.filter((m) => m.status === "active").length; |
| 127 | const pendingMembers = memberships.filter((m) => m.status === "pending").length; |
| 128 | return active + Math.max(pendingMembers, pendingInvitationCount); |
| 129 | }; |
no outgoing calls
no test coverage detected