feat(frontend): add React UI — procurement office, wizard, suppliers, inventory panel (dash port), role-based login
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
// ============================================================
|
||||
// نرمالسازی متن برای جستجو/مقایسهی بخشنده
|
||||
// ============================================================
|
||||
|
||||
const FA_DIGITS = ["۰", "۱", "۲", "۳", "۴", "۵", "۶", "۷", "۸", "۹"];
|
||||
|
||||
function toEn(s: string): string {
|
||||
return String(s).replace(/[۰-۹]/g, (d) => String(FA_DIGITS.indexOf(d)));
|
||||
}
|
||||
|
||||
// trim, lowercase, یکسانسازی ی/ک فارسی و عربی، حذف zero-width non-joiner
|
||||
export function normalize(s: unknown): string {
|
||||
return toEn(String(s == null ? "" : s))
|
||||
.replace(/\u200c/g, "")
|
||||
.trim()
|
||||
.toLowerCase()
|
||||
.replace(/ي/g, "ی")
|
||||
.replace(/ك/g, "ک");
|
||||
}
|
||||
Reference in New Issue
Block a user