mirror of
https://github.com/litruv/unhomoglyph.git
synced 2026-07-24 10:46:14 +10:00
updated to add morre homoglyphs + use english chars only
This commit is contained in:
2
index.js
2
index.js
@@ -14,7 +14,7 @@ function replace_fn(match) {
|
||||
}
|
||||
|
||||
function unhomoglyph(str) {
|
||||
return str.replace(REPLACE_RE, replace_fn);
|
||||
return str.toLowerCase().normalize('NFD').replace(/\p{Diacritic}/gu, "").replace(/[\u200B-\u200D\uFEFF\u034F]/g, '').replace(REPLACE_RE, replace_fn).toLowerCase();
|
||||
}
|
||||
|
||||
module.exports = unhomoglyph;
|
||||
|
||||
Reference in New Issue
Block a user