bigbuffet-rw/src/utils/input.ts
2023-09-18 16:08:54 -05:00

13 lines
No EOL
271 B
TypeScript

/** Trim the username and strip the leading @. */
const normalizeUsername = (username: string): string => {
const trimmed = username.trim();
if (trimmed[0] === '@') {
return trimmed.slice(1);
} else {
return trimmed;
}
};
export {
normalizeUsername,
};