mirror of
https://github.com/nicotsx/zerobyte.git
synced 2026-04-18 05:47:31 -04:00
6 lines
269 B
TypeScript
6 lines
269 B
TypeScript
const USERNAME_ALLOWED_CHARACTERS_REGEX = /^[a-z0-9_.-]+$/i;
|
|
|
|
export const normalizeUsername = (username: string): string => username.trim().toLowerCase();
|
|
|
|
export const isValidUsername = (username: string): boolean => USERNAME_ALLOWED_CHARACTERS_REGEX.test(username);
|