UNPKG

uzbek-translit

Version:

O'zbekcha krill va lotin yozuvlari orasida transliteratsiya qiluvchi TypeScript paket

35 lines (34 loc) 1.03 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.toLotin = toLotin; exports.toKrill = toKrill; var maps_1 = require("./maps"); function toLotin(input) { return input .split("") .map(function (char) { return maps_1.krillToLotinMap[char] || char; }) .join(""); } function toKrill(input) { // Avval maxsus ko‘p harfli ifodalarni almashtiramiz return input .replace(/Sh/g, "Ш") .replace(/sh/g, "ш") .replace(/Ch/g, "Ч") .replace(/ch/g, "ч") .replace(/Gʻ/g, "Ғ") .replace(/gʻ/g, "ғ") .replace(/Oʻ/g, "Ў") .replace(/oʻ/g, "ў") .replace(/Ya/g, "Я") .replace(/ya/g, "я") .replace(/Yo/g, "Ё") .replace(/yo/g, "ё") .replace(/Yu/g, "Ю") .replace(/yu/g, "ю") .replace(/Ye/g, "Е") .replace(/ye/g, "е") .split("") .map(function (char) { return maps_1.lotinToKrillMap[char] || char; }) .join(""); }