add function to replace accent chars with latin chars

This commit is contained in:
Klaxon 2018-10-03 13:26:01 +10:00
parent ac2466a304
commit 04ee2fb3e4
1 changed files with 2 additions and 3 deletions

View File

@ -46,9 +46,8 @@ class RemoveLetterAccents extends Operation {
* @returns {string}
*/
run(input, args) {
// const [firstArg, secondArg] = args;
throw new OperationError("Test");
return input.normalize("NFD").replace(/[\u0300-\u036f]/g, "");
//reference: https://stackoverflow.com/questions/990904/remove-accents-diacritics-in-a-string-in-javascript/37511463
}
}