Use lodash to remove accents and ther diacritics

https://lodash.com/docs/4.17.15#deburr
This commit is contained in:
Ronan Amicel
2022-08-17 18:35:50 +02:00
parent 0249b3d31b
commit 4003d2d7c6
2 changed files with 6 additions and 9 deletions

View File

@@ -55,11 +55,6 @@ export function capitalizeFirstWord(str: string): string {
return str.replace(/\b[a-z]/i, c => c.toUpperCase());
}
// Remove diacritics (accents and other signs).
export function removeDiacritics(text: string): string {
return text.normalize("NFKD").replace(/[\u0300-\u036f]/g, "")
}
// Returns whether the string n represents a valid number.
// http://stackoverflow.com/questions/18082/validate-numbers-in-javascript-isnumeric
export function isNumber(n: string): boolean {