UNPKG

@beenotung/tslib

Version:
30 lines (29 loc) 1.11 kB
/** ****************************** * France mobile phone number * *********************************/ /** * Mobile numbers start with 06 or 07 * Format: 0A BB BB BB BB (10 digits with leading 0 in local format) * Reference: https://en.wikipedia.org/wiki/Telephone_numbers_in_France */ export declare function is_fr_mobile_phone_prefix(tel: string): boolean; /** * with/without +33 prefix */ export declare function is_fr_mobile_phone(tel: number | string): boolean; /** * very forgiving * * @returns +33xxxxxxxxx if valid (9 digits after country code, NO leading 0 in internal format) * empty string if not valid * * Format notes: * - Local format: 06 12 34 56 78 (10 digits WITH leading 0) - used in France * - Internal format: +33 6 12 34 56 78 (9 digits after +33, NO leading 0) - always 9 digits * - Display format: +33 6 12 34 56 78 (formatted by format_fr_mobile_phone) */ export declare function to_full_fr_mobile_phone(tel: string | number): string; /** * @returns +33 x xx xx xx xx if valid */ export declare function format_fr_mobile_phone(tel: string | number): string;