Skip to content

Commit

Permalink
[#3] Goodbye var
Browse files Browse the repository at this point in the history
  • Loading branch information
t-richard committed Nov 16, 2020
1 parent 9c4a284 commit e5c634c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,10 @@ class Index extends HTMLElement {
str = str.replace(/^\s+|\s+$/g, ''); // trim
str = str.toLowerCase();

var from = "àáäâèéëêìíïîòóöôùúüûñç·/_,:;";
var to = "aaaaeeeeiiiioooouuuunc------";
for (var i=0, l=from.length ; i<l ; i++) {
const from = "àáäâèéëêìíïîòóöôùúüûñç·/_,:;";
const to = "aaaaeeeeiiiioooouuuunc------";

for (let i=0, l=from.length ; i<l ; i++) {
str = str.replace(new RegExp(from.charAt(i), 'g'), to.charAt(i));
}

Expand Down

0 comments on commit e5c634c

Please sign in to comment.