mirror of
https://github.com/uetchy/namae.git
synced 2025-08-20 18:08:11 +09:00
fix: sanitize input
This commit is contained in:
@@ -2,3 +2,7 @@ export function capitalize(text: string): string {
|
||||
if (text.length === 0) return '';
|
||||
return text[0].toUpperCase() + text.slice(1).toLowerCase();
|
||||
}
|
||||
|
||||
export function sanitize(text: string): string {
|
||||
return text.replace(/[\s@+!#$%^&*()[\]./<>{}]/g, '');
|
||||
}
|
||||
|
Reference in New Issue
Block a user