srsly tho interesting stuff, I wonder if I should be running a library like this on my usernames? I could imagine that there's an avenue for error if someone uses a weird character but then when you try and access the subdomain it gets changed
https://www.npmjs.com/package/idna-uts46