fix: accounts review

This commit is contained in:
Koosha Lahouti
2025-09-22 12:04:54 +03:30
parent a42da2d4c4
commit 21b7fb27ce
16 changed files with 210 additions and 157 deletions

View File

@@ -0,0 +1,9 @@
const PERSIAN = '۰۱۲۳۴۵۶۷۸۹';
const ARABIC = '٠١٢٣٤٥٦٧٨٩';
export const normalizeDigits = (str: string) =>
str.replace(/[\u06F0-\u06F9\u0660-\u0669]/g, (d) => {
const iP = PERSIAN.indexOf(d);
if (iP !== -1) return String(iP);
const iA = ARABIC.indexOf(d);
return iA !== -1 ? String(iA) : d;
});