chore: init monorepo
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
const converter = {
|
||||
'а': 'a', 'б': 'b', 'в': 'v', 'г': 'g', 'д': 'd',
|
||||
'е': 'e', 'ё': 'e', 'ж': 'zh', 'з': 'z', 'и': 'i',
|
||||
'й': 'y', 'к': 'k', 'л': 'l', 'м': 'm', 'н': 'n',
|
||||
'о': 'o', 'п': 'p', 'р': 'r', 'с': 's', 'т': 't',
|
||||
'у': 'u', 'ф': 'f', 'х': 'h', 'ц': 'c', 'ч': 'ch',
|
||||
'ш': 'sh', 'щ': 'sch', 'ь': '', 'ы': 'y', 'ъ': '',
|
||||
'э': 'e', 'ю': 'yu', 'я': 'ya', ' ': "_",
|
||||
};
|
||||
// TODO: if language not cyrillic or latin (ex chinese), may cause errors, but mne pofig
|
||||
export function translit(word){
|
||||
return word.toLowerCase().split("").map(letter => converter[letter] === undefined ? letter : converter[letter]).join("")
|
||||
}
|
||||
Reference in New Issue
Block a user