@beenotung/tslib
Version:
utils library in Typescript
30 lines (29 loc) • 1.11 kB
TypeScript
/** ******************************
* Netherlands mobile phone number *
*********************************/
/**
* Mobile numbers start with 06
* Format: 0A BBB BBBB (9 digits with leading 0 in local format)
* Reference: https://en.wikipedia.org/wiki/Telephone_numbers_in_the_Netherlands
*/
export declare function is_nl_mobile_phone_prefix(tel: string): boolean;
/**
* with/without +31 prefix
*/
export declare function is_nl_mobile_phone(tel: number | string): boolean;
/**
* very forgiving
*
* @returns +31xxxxxxxxx if valid (9 digits after country code, NO leading 0 in internal format)
* empty string if not valid
*
* Format notes:
* - Local format: 06 12345678 (9 digits WITH leading 0) - used in Netherlands
* - Internal format: +31 6 12345678 (9 digits after +31, NO leading 0) - always 9 digits
* - Display format: +31 6 12345678 (formatted by format_nl_mobile_phone)
*/
export declare function to_full_nl_mobile_phone(tel: string | number): string;
/**
* @returns +31 6 xxxx xxxx if valid
*/
export declare function format_nl_mobile_phone(tel: string | number): string;