import { parsePhoneNumber } from "https://deno.land/x/phonenumber@v7.2.0/index.d.ts";
Parse a phone number into an object describing the number.
Examples
Example 1
Example 1
// Using a national phone number format
parsePhoneNumber( '0707123456', { regionCode: 'SE' } )
// Using an international (e164) phone number format
parsePhoneNumber( '+46707123456' )
The options object is on the form:
{
regionCode?: string;
}
Parameters
Either an e164
formatted (international) phone number
or a national phone number.
optional
options: PhoneNumberParseOptionsObject of type PhoneNumberParseOptions.