(groups: { group_access_level: number }[])
| 193 | }; |
| 194 | |
| 195 | export function getMaxAccess(groups: { group_access_level: number }[]) { |
| 196 | return groups.reduce((previous, current) => { |
| 197 | if (current.group_access_level > previous.group_access_level) { |
| 198 | return current; |
| 199 | } |
| 200 | return previous; |
| 201 | }, groups[0]); |
| 202 | } |
| 203 | |
| 204 | function batch<T>(items: T[], maxPerBatch: number, action: (items: T[]) => void) { |
| 205 | for (let index = 0; index < items.length; index = index + maxPerBatch) { |
no outgoing calls
no test coverage detected