MauritsWilke / mcpfp

A website to generate Minecraft profile pictures
https://minecraftpfp.com/
MIT License
158 stars 31 forks source link

Compacting Code / Minor Bug Fixes #5

Closed Leialoha closed 1 year ago

Leialoha commented 1 year ago

You can use return username.match(/^[a-z0-9_]{3,16}$/i); without having to use an if else condition.

For username checking, the usernames have to be from 3 to 16 {3,16} characters, using * will check for names with 0 or more characters, which are not valid usernames.

MauritsWilke commented 1 year ago

Hey thanks for the PR! Fixed a rookie mistake there :)

Before I merge, Minecraft usernames can indeed not have a length of 0 but they can have one letter: https://namemc.com/profile/F.1

So just having {1,16} would be enough!

MauritsWilke commented 1 year ago

Seems good! Thanks a lot!