Skip to content

Commit

Permalink
update operation
Browse files Browse the repository at this point in the history
  • Loading branch information
klaxon1 committed Oct 11, 2018
1 parent f1ffe19 commit 54793f2
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions src/core/operations/RemoveLetterAccents.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
*/

import Operation from "../Operation";
import OperationError from "../errors/OperationError";

/**
* Remove Letter Accents operation
Expand All @@ -25,18 +24,6 @@ class RemoveLetterAccents extends Operation {
this.inputType = "string";
this.outputType = "string";
this.args = [
/* Example arguments. See the project wiki for full details.
{
name: "First arg",
type: "string",
value: "Don't Panic"
},
{
name: "Second arg",
type: "number",
value: 42
}
*/
];
}

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

}
Expand Down

0 comments on commit 54793f2

Please sign in to comment.