@gecut/utilities
Version:
The ultimate utility toolkit from Gecut Company, crafted with TypeScript for optimal speed and efficiency. Designed to boost productivity with a suite of fast and optimized tools.
28 lines • 627 B
JavaScript
const charList = [
['ك', 'ک'],
['دِ', 'د'],
['بِ', 'ب'],
['زِ', 'ز'],
['ذِ', 'ذ'],
['شِ', 'ش'],
['سِ', 'س'],
['ى', 'ی'],
['ي', 'ی'],
['١', '۱'],
['٢', '۲'],
['٣', '۳'],
['٤', '۴'],
['٥', '۵'],
['٦', '۶'],
['٧', '۷'],
['٨', '۸'],
['٩', '۹'],
['٠', '۰'],
];
export default function arabicToPersian(text) {
for (const [arabicCharacter, persianCharacter] of charList) {
text = text.replaceAll(arabicCharacter, persianCharacter);
}
return text;
}
//# sourceMappingURL=arabic-to-persian.js.map