feat: complete application updates
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
export function formatCardNumber(raw: string): string {
|
||||
const digits = raw.replace(/\D/g, '')
|
||||
return digits.replace(/(\d{4})(?=\d)/g, '$1 ').trim()
|
||||
}
|
||||
|
||||
export function formatSheba(raw: string): string {
|
||||
const compact = raw.replace(/[\s-]/g, '').toUpperCase()
|
||||
const body = compact.startsWith('IR') ? compact.slice(2) : compact
|
||||
if (body.length < 2) return compact
|
||||
const groups = body.slice(2).replace(/(.{4})/g, '$1 ').trim()
|
||||
return `IR${body.slice(0, 2)} ${groups}`.trim()
|
||||
}
|
||||
Reference in New Issue
Block a user