Random pairing gets surprisingly tricky once you try to avoid repeats
javascript
dev.to
I thought a "random pairing" tool would be a half-hour job. Shuffle a list, take names two at a time, done. The annoying part only showed up when I tried to make it usable for recurring things like coffee chats, book clubs, and gift exchanges. "Random" is easy. "Random, but please stop giving me the same pairings as last month" is where the implementation stops being trivial. The input cleanup is doing more than it looks like The first thing the component does is normalize the paste