Drarig29 / brackets-manager.js

A simple library to manage tournament brackets (round-robin, single elimination, double elimination).
https://drarig29.github.io/brackets-docs
MIT License
245 stars 38 forks source link

Support seedings with mixed data types #148

Open Drarig29 opened 1 year ago

Drarig29 commented 1 year ago

Currently, the type of an input seeding is (number | string | null)[] but we could consider this:

(number | null)[] | (string | null)[]

Because we have this logic: https://github.com/Drarig29/brackets-manager.js/blob/fc19bff92e2e8bd152bf97abb16c1cb6e114dd36/src/create.ts#L487-L490

Supporting this would allow to give [1, 'Team 2'], which would use the existing participant with ID 1 and create a "Team 2" participant.