const collection = new Collection<Readonly<{
name: string,
team: string,
}>>();
const ixTeamSizes = collection.registerIndex(
group(
(p) => p.team,
countIndex()
)
);
console.log(ixTeamSizes.get("Team One")?.value)
Generated using TypeDoc
Groups input by a function and maintains a separate index for each group.