mirror of
https://github.com/uetchy/namae.git
synced 2025-08-20 18:08:11 +09:00
fix: normalize diacritics
This commit is contained in:
@@ -4,7 +4,10 @@ export function capitalize(text: string): string {
|
||||
}
|
||||
|
||||
export function sanitize(text: string): string {
|
||||
return text.replace(/[\s@+!#$%^&*()[\]./<>{}]/g, '');
|
||||
return text
|
||||
.replace(/[\s@+!#$%^&*()[\]./<>{}]/g, '')
|
||||
.normalize('NFD')
|
||||
.replace(/[\u0300-\u036f]/g, '');
|
||||
}
|
||||
|
||||
export function upper(word: string): string {
|
||||
|
Reference in New Issue
Block a user