Initialize the API and add managed app banners.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-09-09 17:08:47 +03:30
co-authored by Cursor
commit b15fefe438
158 changed files with 25624 additions and 0 deletions
+20
View File
@@ -0,0 +1,20 @@
export function normalizePhone(raw: string): string {
let digits = raw.replace(/\D/g, '');
if (digits.startsWith('98') && digits.length === 12) {
digits = `0${digits.slice(2)}`;
}
if (digits.length === 10 && digits.startsWith('9')) {
digits = `0${digits}`;
}
return digits;
}
export function isValidPhone(phone: string): boolean {
return /^09\d{9}$/.test(phone);
}
export function toEnglishDigits(value: string): string {
return value
.replace(/[۰-۹]/g, (d) => String('۰۱۲۳۴۵۶۷۸۹'.indexOf(d)))
.replace(/[٠-٩]/g, (d) => String('٠١٢٣٤٥٦٧٨٩'.indexOf(d)));
}