Security update to Drupal 8.4.6
[yaffs-website] / node_modules / underscore.string / cleanDiacritics.js
1
2 var makeString = require('./helper/makeString');
3
4 var from  = "ąàáäâãåæăćčĉęèéëêĝĥìíïîĵłľńňòóöőôõðøśșşšŝťțţŭùúüűûñÿýçżźž",
5     to    = "aaaaaaaaaccceeeeeghiiiijllnnoooooooossssstttuuuuuunyyczzz";
6
7 from += from.toUpperCase();
8 to += to.toUpperCase();
9
10 to = to.split("");
11
12 // for tokens requireing multitoken output
13 from += "ß";
14 to.push('ss');
15
16
17 module.exports = function cleanDiacritics(str) {
18     return makeString(str).replace(/.{1}/g, function(c){
19       var index = from.indexOf(c);
20       return index === -1 ? c : to[index];
21   });
22 };