(config: ShardingConfig["Service"])
| 395 | * @since 4.0.0 |
| 396 | */ |
| 397 | export const shardGroupConfig = (config: ShardingConfig["Service"]): { |
| 398 | readonly available: ReadonlySet<string> |
| 399 | readonly assigned: ReadonlySet<string> |
| 400 | } => { |
| 401 | const available = new Set(config.availableShardGroups.slice().sort()) |
| 402 | const assigned = new Set<string>() |
| 403 | available.forEach((group) => { |
| 404 | if (config.assignedShardGroups.includes(group)) { |
| 405 | assigned.add(group) |
| 406 | } |
| 407 | }) |
| 408 | return { available, assigned } |
| 409 | } |
no test coverage detected