refactor: simplify architecture and remove unused dependencies
parent
cfe389dd00
commit
c38d996e50
@ -0,0 +1,12 @@
|
|||||||
|
// Simple phone number normalization
|
||||||
|
export function normalizePhone(input: string): string {
|
||||||
|
// Remove all non-digit characters
|
||||||
|
let digits = input.replace(/\D/g, '');
|
||||||
|
|
||||||
|
// Ensure country code (default to +34 for Spain)
|
||||||
|
if (!digits.startsWith('34') && digits.length === 9) {
|
||||||
|
digits = '34' + digits;
|
||||||
|
}
|
||||||
|
|
||||||
|
return `+${digits}`;
|
||||||
|
}
|
Loading…
Reference in New Issue