Comparing version 0.0.6 to 1.0.2
1043
lib/index.js
var iso3166_data = [ | ||
{"alpha2": "AW", "alpha3": "ABW", "country_code": "297", "phone_number_lengths": [7], "mobile_begin_with": ["5", "6", "7", "9"]}, | ||
{"alpha2": "AF", "alpha3": "AFG", "country_code": "93", "phone_number_lengths": [9], "mobile_begin_with": ["7"]}, | ||
{"alpha2": "AO", "alpha3": "AGO", "country_code": "244", "phone_number_lengths": [9], "mobile_begin_with": ["9"]}, | ||
{"alpha2": "AI", "alpha3": "AIA", "country_code": "1", "phone_number_lengths": [7], "mobile_begin_with": ["5", "7"]}, | ||
{"alpha2": "AX", "alpha3": "ALA", "country_code": "358", "phone_number_lengths": [6, 7, 8], "mobile_begin_with": ["18"]}, | ||
{"alpha2": "AL", "alpha3": "ALB", "country_code": "355", "phone_number_lengths": [8], "mobile_begin_with": ["6"]}, | ||
{"alpha2": "AD", "alpha3": "AND", "country_code": "376", "phone_number_lengths": [6], "mobile_begin_with": ["3", "4", "6"]}, | ||
{"alpha2": "AN", "alpha3": "ANT", "country_code": "599", "phone_number_lengths": [], "mobile_begin_with": []}, | ||
{"alpha2": "AE", "alpha3": "ARE", "country_code": "971", "phone_number_lengths": [9], "mobile_begin_with": ["5"]}, | ||
{"alpha2": "AR", "alpha3": "ARG", "country_code": "54", "phone_number_lengths": [10], "mobile_begin_with": []}, | ||
{"alpha2": "AM", "alpha3": "ARM", "country_code": "374", "phone_number_lengths": [8], "mobile_begin_with": ["5", "7", "9"]}, | ||
{"alpha2": "AS", "alpha3": "ASM", "country_code": "1", "phone_number_lengths": [7], "mobile_begin_with": ["733", "258"]}, | ||
{"alpha2": "AQ", "alpha3": "ATA", "country_code": "672", "phone_number_lengths": [], "mobile_begin_with": []}, | ||
{"alpha2": "TF", "alpha3": "ATF", "country_code": "", "phone_number_lengths": [], "mobile_begin_with": []}, | ||
{"alpha2": "AG", "alpha3": "ATG", "country_code": "1", "phone_number_lengths": [7], "mobile_begin_with": ["4", "7"]}, | ||
{"alpha2": "AU", "alpha3": "AUS", "country_code": "61", "phone_number_lengths": [9], "mobile_begin_with": ["4"]}, | ||
{"alpha2": "AT", "alpha3": "AUT", "country_code": "43", "phone_number_lengths": [10], "mobile_begin_with": ["6"]}, | ||
{"alpha2": "AZ", "alpha3": "AZE", "country_code": "994", "phone_number_lengths": [9], "mobile_begin_with": ["4", "5", "6", "7"]}, | ||
{"alpha2": "BI", "alpha3": "BDI", "country_code": "257", "phone_number_lengths": [8], "mobile_begin_with": ["7", "29"]}, | ||
{"alpha2": "BE", "alpha3": "BEL", "country_code": "32", "phone_number_lengths": [9], "mobile_begin_with": ["4"]}, | ||
{"alpha2": "BJ", "alpha3": "BEN", "country_code": "229", "phone_number_lengths": [8], "mobile_begin_with": ["9"]}, | ||
{"alpha2": "BF", "alpha3": "BFA", "country_code": "226", "phone_number_lengths": [8], "mobile_begin_with": ["6", "7"]}, | ||
{"alpha2": "BD", "alpha3": "BGD", "country_code": "880", "phone_number_lengths": [8, 9, 10], "mobile_begin_with": ["1"]}, | ||
{"alpha2": "BG", "alpha3": "BGR", "country_code": "359", "phone_number_lengths": [8, 9], "mobile_begin_with": ["87", "88", "89", "98", "99", "43"]}, | ||
{"alpha2": "BH", "alpha3": "BHR", "country_code": "973", "phone_number_lengths": [8], "mobile_begin_with": ["3"]}, | ||
{"alpha2": "BS", "alpha3": "BHS", "country_code": "1", "phone_number_lengths": [7], "mobile_begin_with": ["3", "4", "5", "6", "7"]}, | ||
{"alpha2": "BA", "alpha3": "BIH", "country_code": "387", "phone_number_lengths": [8], "mobile_begin_with": ["6"]}, | ||
{"alpha2": "BL", "alpha3": "BLM", "country_code": "590", "phone_number_lengths": [], "mobile_begin_with": []}, | ||
{"alpha2": "BY", "alpha3": "BLR", "country_code": "375", "phone_number_lengths": [9], "mobile_begin_with": ["25", "29", "33", "44"]}, | ||
{"alpha2": "BZ", "alpha3": "BLZ", "country_code": "501", "phone_number_lengths": [7], "mobile_begin_with": ["6"]}, | ||
{"alpha2": "BM", "alpha3": "BMU", "country_code": "1", "phone_number_lengths": [7], "mobile_begin_with": ["3", "5", "7"]}, | ||
{"alpha2": "BO", "alpha3": "BOL", "country_code": "591", "phone_number_lengths": [8], "mobile_begin_with": ["7"]}, | ||
{"alpha2": "BR", "alpha3": "BRA", "country_code": "55", "phone_number_lengths": [10, 11], "mobile_begin_with": []}, | ||
{"alpha2": "BB", "alpha3": "BRB", "country_code": "1", "phone_number_lengths": [7], "mobile_begin_with": []}, | ||
{"alpha2": "BN", "alpha3": "BRN", "country_code": "673", "phone_number_lengths": [7], "mobile_begin_with": ["7", "8"]}, | ||
{"alpha2": "BT", "alpha3": "BTN", "country_code": "975", "phone_number_lengths": [8], "mobile_begin_with": ["17"]}, | ||
{"alpha2": "BV", "alpha3": "BVT", "country_code": "", "phone_number_lengths": [], "mobile_begin_with": []}, | ||
{"alpha2": "BW", "alpha3": "BWA", "country_code": "267", "phone_number_lengths": [8], "mobile_begin_with": ["71", "72", "73", "74", "75", "76"]}, | ||
{"alpha2": "CF", "alpha3": "CAF", "country_code": "236", "phone_number_lengths": [8], "mobile_begin_with": ["7"]}, | ||
// http://www.howtocallabroad.com/canada/ | ||
// http://areacode.org/ | ||
// http://countrycode.org/canada | ||
{"alpha2": "CA", "alpha3": "CAN", "country_code": "1", "phone_number_lengths": [10], | ||
"mobile_begin_with": ["204", "226", "236", "249", "250", "289", "306", "343", "365", "403", "416", "418", | ||
"431", "437", "438", "450", "506", "514", "519", "579", "581", "587", "600", "604", "613", "639", "647", | ||
"705", "709", "778", "780", "807", "819", "867", "873", "902", "905"]}, | ||
{"alpha2": "CC", "alpha3": "CCK", "country_code": "61", "phone_number_lengths": [], "mobile_begin_with": []}, | ||
{"alpha2": "CH", "alpha3": "CHE", "country_code": "41", "phone_number_lengths": [9], "mobile_begin_with": ["7"]}, | ||
{"alpha2": "CL", "alpha3": "CHL", "country_code": "56", "phone_number_lengths": [9], "mobile_begin_with": ["9"]}, | ||
{"alpha2": "CN", "alpha3": "CHN", "country_code": "86", "phone_number_lengths": [11], "mobile_begin_with": ["13", "14", "15", "18"]}, | ||
{"alpha2": "CI", "alpha3": "CIV", "country_code": "225", "phone_number_lengths": [8], "mobile_begin_with": ["0", "4", "5", "6"]}, | ||
{"alpha2": "CM", "alpha3": "CMR", "country_code": "237", "phone_number_lengths": [8], "mobile_begin_with": ["7", "9"]}, | ||
{"alpha2": "CD", "alpha3": "COD", "country_code": "243", "phone_number_lengths": [9], "mobile_begin_with": ["8", "9"]}, | ||
{"alpha2": "CG", "alpha3": "COG", "country_code": "242", "phone_number_lengths": [9], "mobile_begin_with": ["0"]}, | ||
{"alpha2": "CK", "alpha3": "COK", "country_code": "682", "phone_number_lengths": [5], "mobile_begin_with": ["5", "7"]}, | ||
{"alpha2": "CO", "alpha3": "COL", "country_code": "57", "phone_number_lengths": [10], "mobile_begin_with": ["3"]}, | ||
{"alpha2": "KM", "alpha3": "COM", "country_code": "269", "phone_number_lengths": [7], "mobile_begin_with": ["3", "76"]}, | ||
{"alpha2": "CV", "alpha3": "CPV", "country_code": "238", "phone_number_lengths": [7], "mobile_begin_with": ["5", "9"]}, | ||
{"alpha2": "CR", "alpha3": "CRI", "country_code": "506", "phone_number_lengths": [8], "mobile_begin_with": ["5", "6", "7", "8"]}, | ||
{"alpha2": "CU", "alpha3": "CUB", "country_code": "53", "phone_number_lengths": [8], "mobile_begin_with": ["5"]}, | ||
{"alpha2": "CX", "alpha3": "CXR", "country_code": "61", "phone_number_lengths": [], "mobile_begin_with": []}, | ||
{"alpha2": "KY", "alpha3": "CYM", "country_code": "1", "phone_number_lengths": [10], "mobile_begin_with": ["345"]}, | ||
{"alpha2": "CY", "alpha3": "CYP", "country_code": "357", "phone_number_lengths": [8], "mobile_begin_with": ["9"]}, | ||
{"alpha2": "CZ", "alpha3": "CZE", "country_code": "420", "phone_number_lengths": [9], "mobile_begin_with": ["6", "7"]}, | ||
{"alpha2": "DE", "alpha3": "DEU", "country_code": "49", "phone_number_lengths": [10, 11], "mobile_begin_with": ["15", "16", "17"]}, | ||
{"alpha2": "DJ", "alpha3": "DJI", "country_code": "253", "phone_number_lengths": [8], "mobile_begin_with": ["77"]}, | ||
{"alpha2": "DM", "alpha3": "DMA", "country_code": "1", "phone_number_lengths": [7], "mobile_begin_with": []}, | ||
{"alpha2": "DK", "alpha3": "DNK", "country_code": "45", "phone_number_lengths": [8], "mobile_begin_with": []}, | ||
{"alpha2": "DO", "alpha3": "DOM", "country_code": "1", "phone_number_lengths": [10], "mobile_begin_with": ["809", "829", "849"]}, | ||
{"alpha2": "DZ", "alpha3": "DZA", "country_code": "213", "phone_number_lengths": [9], "mobile_begin_with": ["5", "6", "7"]}, | ||
{"alpha2": "EC", "alpha3": "ECU", "country_code": "593", "phone_number_lengths": [9], "mobile_begin_with": ["9"]}, | ||
{"alpha2": "EG", "alpha3": "EGY", "country_code": "20", "phone_number_lengths": [10], "mobile_begin_with": ["1"]}, | ||
{"alpha2": "ER", "alpha3": "ERI", "country_code": "291", "phone_number_lengths": [7], "mobile_begin_with": ["1", "7", "8"]}, | ||
{"alpha2": "EH", "alpha3": "ESH", "country_code": "212", "phone_number_lengths": [], "mobile_begin_with": []}, | ||
{"alpha2": "ES", "alpha3": "ESP", "country_code": "34", "phone_number_lengths": [9], "mobile_begin_with": ["6", "7"]}, | ||
{"alpha2": "EE", "alpha3": "EST", "country_code": "372", "phone_number_lengths": [8], "mobile_begin_with": ["5"]}, | ||
{"alpha2": "ET", "alpha3": "ETH", "country_code": "251", "phone_number_lengths": [9], "mobile_begin_with": ["9"]}, | ||
{"alpha2": "FI", "alpha3": "FIN", "country_code": "358", "phone_number_lengths": [9], "mobile_begin_with": ["4", "5"]}, | ||
{"alpha2": "FJ", "alpha3": "FJI", "country_code": "679", "phone_number_lengths": [7], "mobile_begin_with": ["7", "9"]}, | ||
{"alpha2": "FK", "alpha3": "FLK", "country_code": "500", "phone_number_lengths": [5], "mobile_begin_with": ["5", "6"]}, | ||
{"alpha2": "FR", "alpha3": "FRA", "country_code": "33", "phone_number_lengths": [9], "mobile_begin_with": ["6", "7"]}, | ||
{"alpha2": "FO", "alpha3": "FRO", "country_code": "298", "phone_number_lengths": [6], "mobile_begin_with": []}, | ||
{"alpha2": "FM", "alpha3": "FSM", "country_code": "691", "phone_number_lengths": [7], "mobile_begin_with": []}, | ||
{"alpha2": "GA", "alpha3": "GAB", "country_code": "241", "phone_number_lengths": [8], "mobile_begin_with": ["05", "06", "07"]}, | ||
//http://www.area-codes.org.uk/ http://www.area-codes.org.uk/07-mobile-codes.php | ||
{"alpha2": "GB", "alpha3": "GBR", "country_code": "44", "phone_number_lengths": [10], "mobile_begin_with": ["7"]}, | ||
{"alpha2": "GE", "alpha3": "GEO", "country_code": "995", "phone_number_lengths": [9], "mobile_begin_with": ["5", "7"]}, | ||
{"alpha2": "GG", "alpha3": "GGY", "country_code": "44", "phone_number_lengths": [], "mobile_begin_with": []}, | ||
{"alpha2": "GH", "alpha3": "GHA", "country_code": "233", "phone_number_lengths": [9], "mobile_begin_with": ["2", "5"]}, | ||
{"alpha2": "GI", "alpha3": "GIB", "country_code": "350", "phone_number_lengths": [8], "mobile_begin_with": ["5"]}, | ||
{"alpha2": "GN", "alpha3": "GIN", "country_code": "224", "phone_number_lengths": [8], "mobile_begin_with": ["6"]}, | ||
{"alpha2": "GP", "alpha3": "GLP", "country_code": "590", "phone_number_lengths": [9], "mobile_begin_with": ["690"]}, | ||
{"alpha2": "GM", "alpha3": "GMB", "country_code": "220", "phone_number_lengths": [7], "mobile_begin_with": ["7", "9"]}, | ||
{"alpha2": "GW", "alpha3": "GNB", "country_code": "245", "phone_number_lengths": [7], "mobile_begin_with": ["5", "6", "7"]}, | ||
{"alpha2": "GQ", "alpha3": "GNQ", "country_code": "240", "phone_number_lengths": [9], "mobile_begin_with": ["222", "551"]}, | ||
{"alpha2": "GR", "alpha3": "GRC", "country_code": "30", "phone_number_lengths": [10], "mobile_begin_with": ["6"]}, | ||
{"alpha2": "GD", "alpha3": "GRD", "country_code": "1", "phone_number_lengths": [7], "mobile_begin_with": []}, | ||
{"alpha2": "GL", "alpha3": "GRL", "country_code": "299", "phone_number_lengths": [6], "mobile_begin_with": ["4", "5"]}, | ||
{"alpha2": "GT", "alpha3": "GTM", "country_code": "502", "phone_number_lengths": [8], "mobile_begin_with": ["3", "4", "5"]}, | ||
{"alpha2": "GF", "alpha3": "GUF", "country_code": "594", "phone_number_lengths": [9], "mobile_begin_with": ["694"]}, | ||
{"alpha2": "GU", "alpha3": "GUM", "country_code": "1", "phone_number_lengths": [7], "mobile_begin_with": []}, | ||
{"alpha2": "GY", "alpha3": "GUY", "country_code": "592", "phone_number_lengths": [7], "mobile_begin_with": ["6"]}, | ||
{"alpha2": "HK", "alpha3": "HKG", "country_code": "852", "phone_number_lengths": [8], "mobile_begin_with": ["5", "6", "9"]}, | ||
{"alpha2": "HM", "alpha3": "HMD", "country_code": "", "phone_number_lengths": [], "mobile_begin_with": []}, | ||
{"alpha2": "HN", "alpha3": "HND", "country_code": "504", "phone_number_lengths": [8], "mobile_begin_with": ["3", "7", "8", "9"]}, | ||
{"alpha2": "HR", "alpha3": "HRV", "country_code": "385", "phone_number_lengths": [9], "mobile_begin_with": ["9"]}, | ||
{"alpha2": "HT", "alpha3": "HTI", "country_code": "509", "phone_number_lengths": [8], "mobile_begin_with": ["3", "4"]}, | ||
{"alpha2": "HU", "alpha3": "HUN", "country_code": "36", "phone_number_lengths": [9], "mobile_begin_with": ["20", "30", "31", "70"]}, | ||
{"alpha2": "ID", "alpha3": "IDN", "country_code": "62", "phone_number_lengths": [9, 10, 11], "mobile_begin_with": ["8"]}, | ||
{"alpha2": "IM", "alpha3": "IMN", "country_code": "44", "phone_number_lengths": [], "mobile_begin_with": []}, | ||
{"alpha2": "IN", "alpha3": "IND", "country_code": "91", "phone_number_lengths": [10], "mobile_begin_with": ["7", "8", "9"]}, | ||
{"alpha2": "IO", "alpha3": "IOT", "country_code": "246", "phone_number_lengths": [], "mobile_begin_with": []}, | ||
{"alpha2": "IE", "alpha3": "IRL", "country_code": "353", "phone_number_lengths": [9], "mobile_begin_with": ["82", "83", "84", "85", "86", "87", "88", "89"]}, | ||
{"alpha2": "IR", "alpha3": "IRN", "country_code": "98", "phone_number_lengths": [10], "mobile_begin_with": ["9"]}, | ||
{"alpha2": "IQ", "alpha3": "IRQ", "country_code": "964", "phone_number_lengths": [10], "mobile_begin_with": ["7"]}, | ||
// Iceland only have 7 digits, no more area code for mobile | ||
{"alpha2": "IS", "alpha3": "ISL", "country_code": "354", "phone_number_lengths": [7], "mobile_begin_with": ["6", "7", "8"]}, | ||
{"alpha2": "IL", "alpha3": "ISR", "country_code": "972", "phone_number_lengths": [9], "mobile_begin_with": ["5"]}, | ||
{"alpha2": "IT", "alpha3": "ITA", "country_code": "39", "phone_number_lengths": [10], "mobile_begin_with": ["3"]}, | ||
{"alpha2": "JM", "alpha3": "JAM", "country_code": "1", "phone_number_lengths": [7], "mobile_begin_with": []}, | ||
{"alpha2": "JE", "alpha3": "JEY", "country_code": "44", "phone_number_lengths": [], "mobile_begin_with": []}, | ||
{"alpha2": "JO", "alpha3": "JOR", "country_code": "962", "phone_number_lengths": [9], "mobile_begin_with": ["7"]}, | ||
{"alpha2": "JP", "alpha3": "JPN", "country_code": "81", "phone_number_lengths": [10], "mobile_begin_with": ["70", "80", "90"]}, | ||
{"alpha2": "KZ", "alpha3": "KAZ", "country_code": "7", "phone_number_lengths": [10], "mobile_begin_with": ["70", "77"]}, | ||
{"alpha2": "KE", "alpha3": "KEN", "country_code": "254", "phone_number_lengths": [9], "mobile_begin_with": ["7"]}, | ||
{"alpha2": "KG", "alpha3": "KGZ", "country_code": "996", "phone_number_lengths": [9], "mobile_begin_with": ["5", "7"]}, | ||
{"alpha2": "KH", "alpha3": "KHM", "country_code": "855", "phone_number_lengths": [8, 9], "mobile_begin_with": ["1", "6", "7", "8", "9"]}, | ||
{"alpha2": "KI", "alpha3": "KIR", "country_code": "686", "phone_number_lengths": [5], "mobile_begin_with": ["9", "30"]}, | ||
{"alpha2": "KN", "alpha3": "KNA", "country_code": "1", "phone_number_lengths": [7], "mobile_begin_with": []}, | ||
{"alpha2": "KR", "alpha3": "KOR", "country_code": "82", "phone_number_lengths": [9, 10], "mobile_begin_with": ["1"]}, | ||
{"alpha2": "KW", "alpha3": "KWT", "country_code": "965", "phone_number_lengths": [8], "mobile_begin_with": ["5", "6", "9"]}, | ||
{"alpha2": "LA", "alpha3": "LAO", "country_code": "856", "phone_number_lengths": [10], "mobile_begin_with": ["20"]}, | ||
{"alpha2": "LB", "alpha3": "LBN", "country_code": "961", "phone_number_lengths": [7, 8], "mobile_begin_with": ["3", "7"]}, | ||
{"alpha2": "LR", "alpha3": "LBR", "country_code": "231", "phone_number_lengths": [7, 8], "mobile_begin_with": ["4", "5", "6", "7"]}, | ||
{"alpha2": "LY", "alpha3": "LBY", "country_code": "218", "phone_number_lengths": [9], "mobile_begin_with": ["9"]}, | ||
{"alpha2": "LC", "alpha3": "LCA", "country_code": "1", "phone_number_lengths": [7], "mobile_begin_with": []}, | ||
{"alpha2": "LI", "alpha3": "LIE", "country_code": "423", "phone_number_lengths": [7], "mobile_begin_with": ["7"]}, | ||
{"alpha2": "LK", "alpha3": "LKA", "country_code": "94", "phone_number_lengths": [9], "mobile_begin_with": ["7"]}, | ||
{"alpha2": "LS", "alpha3": "LSO", "country_code": "266", "phone_number_lengths": [8], "mobile_begin_with": ["5", "6"]}, | ||
{"alpha2": "LT", "alpha3": "LTU", "country_code": "370", "phone_number_lengths": [8], "mobile_begin_with": ["6"]}, | ||
{"alpha2": "LU", "alpha3": "LUX", "country_code": "352", "phone_number_lengths": [9], "mobile_begin_with": ["6"]}, | ||
{"alpha2": "LV", "alpha3": "LVA", "country_code": "371", "phone_number_lengths": [8], "mobile_begin_with": ["2"]}, | ||
{"alpha2": "MO", "alpha3": "MAC", "country_code": "853", "phone_number_lengths": [8], "mobile_begin_with": ["6"]}, | ||
{"alpha2": "MF", "alpha3": "MAF", "country_code": "590", "phone_number_lengths": [], "mobile_begin_with": []}, | ||
{"alpha2": "MA", "alpha3": "MAR", "country_code": "212", "phone_number_lengths": [9], "mobile_begin_with": ["6"]}, | ||
{"alpha2": "MC", "alpha3": "MCO", "country_code": "377", "phone_number_lengths": [8, 9], "mobile_begin_with": ["4", "6"]}, | ||
{"alpha2": "MD", "alpha3": "MDA", "country_code": "373", "phone_number_lengths": [8], "mobile_begin_with": ["6", "7"]}, | ||
{"alpha2": "MG", "alpha3": "MDG", "country_code": "261", "phone_number_lengths": [9], "mobile_begin_with": ["3"]}, | ||
{"alpha2": "MV", "alpha3": "MDV", "country_code": "960", "phone_number_lengths": [7], "mobile_begin_with": ["7", "9"]}, | ||
{"alpha2": "MX", "alpha3": "MEX", "country_code": "52", "phone_number_lengths": [11], "mobile_begin_with": ["1"]}, | ||
{"alpha2": "MH", "alpha3": "MHL", "country_code": "692", "phone_number_lengths": [7], "mobile_begin_with": []}, | ||
{"alpha2": "MK", "alpha3": "MKD", "country_code": "389", "phone_number_lengths": [8], "mobile_begin_with": ["7"]}, | ||
{"alpha2": "ML", "alpha3": "MLI", "country_code": "223", "phone_number_lengths": [8], "mobile_begin_with": ["6", "7"]}, | ||
{"alpha2": "MT", "alpha3": "MLT", "country_code": "356", "phone_number_lengths": [8], "mobile_begin_with": ["79", "99"]}, | ||
{"alpha2": "MM", "alpha3": "MMR", "country_code": "95", "phone_number_lengths": [8], "mobile_begin_with": ["9"]}, | ||
{"alpha2": "ME", "alpha3": "MNE", "country_code": "382", "phone_number_lengths": [8], "mobile_begin_with": ["6"]}, | ||
{"alpha2": "MN", "alpha3": "MNG", "country_code": "976", "phone_number_lengths": [8], "mobile_begin_with": ["5", "8", "9"]}, | ||
{"alpha2": "MP", "alpha3": "MNP", "country_code": "1", "phone_number_lengths": [7], "mobile_begin_with": []}, | ||
{"alpha2": "MZ", "alpha3": "MOZ", "country_code": "258", "phone_number_lengths": [9], "mobile_begin_with": ["8"]}, | ||
{"alpha2": "MR", "alpha3": "MRT", "country_code": "222", "phone_number_lengths": [8], "mobile_begin_with": []}, | ||
{"alpha2": "MS", "alpha3": "MSR", "country_code": "1", "phone_number_lengths": [7], "mobile_begin_with": []}, | ||
{"alpha2": "MQ", "alpha3": "MTQ", "country_code": "596", "phone_number_lengths": [9], "mobile_begin_with": ["696"]}, | ||
{"alpha2": "MU", "alpha3": "MUS", "country_code": "230", "phone_number_lengths": [7], "mobile_begin_with": []}, | ||
{"alpha2": "MW", "alpha3": "MWI", "country_code": "265", "phone_number_lengths": [9], "mobile_begin_with": ["77", "88", "99"]}, | ||
{"alpha2": "MY", "alpha3": "MYS", "country_code": "60", "phone_number_lengths": [9, 10], "mobile_begin_with": ["1"]}, | ||
{"alpha2": "YT", "alpha3": "MYT", "country_code": "269", "phone_number_lengths": [9], "mobile_begin_with": ["639"]}, | ||
{"alpha2": "NA", "alpha3": "NAM", "country_code": "264", "phone_number_lengths": [9], "mobile_begin_with": ["60", "81", "82", "85"]}, | ||
{"alpha2": "NC", "alpha3": "NCL", "country_code": "687", "phone_number_lengths": [6], "mobile_begin_with": []}, | ||
{"alpha2": "NE", "alpha3": "NER", "country_code": "227", "phone_number_lengths": [8], "mobile_begin_with": ["9"]}, | ||
{"alpha2": "NF", "alpha3": "NFK", "country_code": "672", "phone_number_lengths": [5], "mobile_begin_with": ["5", "8"]}, | ||
{"alpha2": "NG", "alpha3": "NGA", "country_code": "234", "phone_number_lengths": [10], "mobile_begin_with": ["70", "80", "81"]}, | ||
{"alpha2": "NI", "alpha3": "NIC", "country_code": "505", "phone_number_lengths": [8], "mobile_begin_with": ["8"]}, | ||
{"alpha2": "NU", "alpha3": "NIU", "country_code": "683", "phone_number_lengths": [4], "mobile_begin_with": []}, | ||
{"alpha2": "NL", "alpha3": "NLD", "country_code": "31", "phone_number_lengths": [9], "mobile_begin_with": ["6"]}, | ||
{"alpha2": "NO", "alpha3": "NOR", "country_code": "47", "phone_number_lengths": [8], "mobile_begin_with": ["4", "9"]}, | ||
{"alpha2": "NP", "alpha3": "NPL", "country_code": "977", "phone_number_lengths": [10], "mobile_begin_with": ["97", "98"]}, | ||
{"alpha2": "NR", "alpha3": "NRU", "country_code": "674", "phone_number_lengths": [7], "mobile_begin_with": ["555"]}, | ||
{"alpha2": "NZ", "alpha3": "NZL", "country_code": "64", "phone_number_lengths": [8, 9, 10], "mobile_begin_with": ["2"]}, | ||
{"alpha2": "OM", "alpha3": "OMN", "country_code": "968", "phone_number_lengths": [8], "mobile_begin_with": ["9"]}, | ||
{"alpha2": "PK", "alpha3": "PAK", "country_code": "92", "phone_number_lengths": [10], "mobile_begin_with": ["3"]}, | ||
{"alpha2": "PA", "alpha3": "PAN", "country_code": "507", "phone_number_lengths": [8], "mobile_begin_with": ["5", "6"]}, | ||
{"alpha2": "PN", "alpha3": "PCN", "country_code": "", "phone_number_lengths": [], "mobile_begin_with": []}, | ||
{"alpha2": "PE", "alpha3": "PER", "country_code": "51", "phone_number_lengths": [9], "mobile_begin_with": ["9"]}, | ||
{"alpha2": "PH", "alpha3": "PHL", "country_code": "63", "phone_number_lengths": [10], "mobile_begin_with": ["9"]}, | ||
{"alpha2": "PW", "alpha3": "PLW", "country_code": "680", "phone_number_lengths": [7], "mobile_begin_with": []}, | ||
{"alpha2": "PG", "alpha3": "PNG", "country_code": "675", "phone_number_lengths": [8], "mobile_begin_with": ["7"]}, | ||
{"alpha2": "PL", "alpha3": "POL", "country_code": "48", "phone_number_lengths": [9], "mobile_begin_with": ["5", "6", "7", "8"]}, | ||
{"alpha2": "PR", "alpha3": "PRI", "country_code": "1", "phone_number_lengths": [7], "mobile_begin_with": []}, | ||
{"alpha2": "KP", "alpha3": "PRK", "country_code": "850", "phone_number_lengths": [], "mobile_begin_with": []}, | ||
{"alpha2": "PT", "alpha3": "PRT", "country_code": "351", "phone_number_lengths": [9], "mobile_begin_with": ["9"]}, | ||
{"alpha2": "PY", "alpha3": "PRY", "country_code": "595", "phone_number_lengths": [9], "mobile_begin_with": ["9"]}, | ||
{"alpha2": "PS", "alpha3": "PSE", "country_code": "970", "phone_number_lengths": [9], "mobile_begin_with": ["5"]}, | ||
{"alpha2": "PF", "alpha3": "PYF", "country_code": "689", "phone_number_lengths": [6], "mobile_begin_with": []}, | ||
{"alpha2": "QA", "alpha3": "QAT", "country_code": "974", "phone_number_lengths": [8], "mobile_begin_with": ["33", "55", "66", "77"]}, | ||
{"alpha2": "RE", "alpha3": "REU", "country_code": "262", "phone_number_lengths": [9], "mobile_begin_with": ["692", "693"]}, | ||
{"alpha2": "RO", "alpha3": "ROU", "country_code": "40", "phone_number_lengths": [9], "mobile_begin_with": ["7"]}, | ||
{"alpha2": "RU", "alpha3": "RUS", "country_code": "7", "phone_number_lengths": [10], "mobile_begin_with": ["9"]}, | ||
{"alpha2": "RW", "alpha3": "RWA", "country_code": "250", "phone_number_lengths": [9], "mobile_begin_with": ["7"]}, | ||
{"alpha2": "SA", "alpha3": "SAU", "country_code": "966", "phone_number_lengths": [9], "mobile_begin_with": ["5"]}, | ||
{"alpha2": "SD", "alpha3": "SDN", "country_code": "249", "phone_number_lengths": [9], "mobile_begin_with": ["9"]}, | ||
{"alpha2": "SN", "alpha3": "SEN", "country_code": "221", "phone_number_lengths": [9], "mobile_begin_with": ["7"]}, | ||
{"alpha2": "SG", "alpha3": "SGP", "country_code": "65", "phone_number_lengths": [8], "mobile_begin_with": ["8", "9"]}, | ||
{"alpha2": "GS", "alpha3": "SGS", "country_code": "500", "phone_number_lengths": [], "mobile_begin_with": []}, | ||
{"alpha2": "SH", "alpha3": "SHN", "country_code": "290", "phone_number_lengths": [4], "mobile_begin_with": []}, | ||
{"alpha2": "SJ", "alpha3": "SJM", "country_code": "47", "phone_number_lengths": [8], "mobile_begin_with": []}, | ||
{"alpha2": "SB", "alpha3": "SLB", "country_code": "677", "phone_number_lengths": [7], "mobile_begin_with": ["7", "8"]}, | ||
{"alpha2": "SL", "alpha3": "SLE", "country_code": "232", "phone_number_lengths": [8], "mobile_begin_with": ["21", "25", "30", "33", "34", "40", "44", "50", "55", "76", "77", "78", "79", "88"]}, | ||
{"alpha2": "SV", "alpha3": "SLV", "country_code": "503", "phone_number_lengths": [8], "mobile_begin_with": ["7"]}, | ||
{"alpha2": "SM", "alpha3": "SMR", "country_code": "378", "phone_number_lengths": [10], "mobile_begin_with": ["3", "6"]}, | ||
{"alpha2": "SO", "alpha3": "SOM", "country_code": "252", "phone_number_lengths": [8], "mobile_begin_with": ["9"]}, | ||
{"alpha2": "PM", "alpha3": "SPM", "country_code": "508", "phone_number_lengths": [6], "mobile_begin_with": ["55"]}, | ||
{"alpha2": "RS", "alpha3": "SRB", "country_code": "381", "phone_number_lengths": [8, 9], "mobile_begin_with": ["6"]}, | ||
{"alpha2": "ST", "alpha3": "STP", "country_code": "239", "phone_number_lengths": [7], "mobile_begin_with": ["98", "99"]}, | ||
{"alpha2": "SR", "alpha3": "SUR", "country_code": "597", "phone_number_lengths": [7], "mobile_begin_with": ["6", "7", "8"]}, | ||
{"alpha2": "SK", "alpha3": "SVK", "country_code": "421", "phone_number_lengths": [9], "mobile_begin_with": ["9"]}, | ||
{"alpha2": "SI", "alpha3": "SVN", "country_code": "386", "phone_number_lengths": [8], "mobile_begin_with": ["3", "4", "5", "6", "7"]}, | ||
{"alpha2": "SE", "alpha3": "SWE", "country_code": "46", "phone_number_lengths": [9], "mobile_begin_with": ["7"]}, | ||
{"alpha2": "SZ", "alpha3": "SWZ", "country_code": "268", "phone_number_lengths": [], "mobile_begin_with": []}, | ||
{"alpha2": "SC", "alpha3": "SYC", "country_code": "248", "phone_number_lengths": [7], "mobile_begin_with": ["2"]}, | ||
{"alpha2": "SY", "alpha3": "SYR", "country_code": "963", "phone_number_lengths": [9], "mobile_begin_with": ["9"]}, | ||
{"alpha2": "TC", "alpha3": "TCA", "country_code": "1", "phone_number_lengths": [7], "mobile_begin_with": ["2", "3", "4"]}, | ||
{"alpha2": "TD", "alpha3": "TCD", "country_code": "235", "phone_number_lengths": [8], "mobile_begin_with": ["6", "7", "9"]}, | ||
{"alpha2": "TG", "alpha3": "TGO", "country_code": "228", "phone_number_lengths": [8], "mobile_begin_with": ["9"]}, | ||
{"alpha2": "TH", "alpha3": "THA", "country_code": "66", "phone_number_lengths": [9], "mobile_begin_with": ["8", "9"]}, | ||
{"alpha2": "TJ", "alpha3": "TJK", "country_code": "992", "phone_number_lengths": [9], "mobile_begin_with": ["9"]}, | ||
{"alpha2": "TK", "alpha3": "TKL", "country_code": "690", "phone_number_lengths": [4], "mobile_begin_with": []}, | ||
{"alpha2": "TM", "alpha3": "TKM", "country_code": "993", "phone_number_lengths": [8], "mobile_begin_with": []}, | ||
{"alpha2": "TL", "alpha3": "TLS", "country_code": "670", "phone_number_lengths": [8], "mobile_begin_with": ["7"]}, | ||
{"alpha2": "TO", "alpha3": "TON", "country_code": "676", "phone_number_lengths": [5], "mobile_begin_with": []}, | ||
{"alpha2": "TT", "alpha3": "TTO", "country_code": "1", "phone_number_lengths": [7], "mobile_begin_with": []}, | ||
{"alpha2": "TN", "alpha3": "TUN", "country_code": "216", "phone_number_lengths": [8], "mobile_begin_with": ["2", "9"]}, | ||
{"alpha2": "TR", "alpha3": "TUR", "country_code": "90", "phone_number_lengths": [10], "mobile_begin_with": ["5"]}, | ||
{"alpha2": "TV", "alpha3": "TUV", "country_code": "688", "phone_number_lengths": [5], "mobile_begin_with": []}, | ||
{"alpha2": "TW", "alpha3": "TWN", "country_code": "886", "phone_number_lengths": [9], "mobile_begin_with": ["9"]}, | ||
{"alpha2": "TZ", "alpha3": "TZA", "country_code": "255", "phone_number_lengths": [9], "mobile_begin_with": ["7"]}, | ||
{"alpha2": "UG", "alpha3": "UGA", "country_code": "256", "phone_number_lengths": [9], "mobile_begin_with": ["7"]}, | ||
{"alpha2": "UA", "alpha3": "UKR", "country_code": "380", "phone_number_lengths": [9], "mobile_begin_with": ["39", "50", "63", "66", "67", "68", "9"]}, | ||
{"alpha2": "UM", "alpha3": "UMI", "country_code": "", "phone_number_lengths": [], "mobile_begin_with": []}, | ||
{"alpha2": "UY", "alpha3": "URY", "country_code": "598", "phone_number_lengths": [8], "mobile_begin_with": ["9"]}, | ||
// if no country is given, default to USA. DO NOT move this position | ||
// http://en.wikipedia.org/wiki/List_of_North_American_Numbering_Plan_area_codes#900.E2.80.93999 | ||
@@ -245,373 +8,311 @@ // http://www.howtocallabroad.com/usa/ | ||
// http://countrycode.org/usa | ||
{"alpha2": "US", "alpha3": "USA", "country_code": "1", "phone_number_lengths": [10], | ||
"mobile_begin_with": ["201", "202", "203", "205", "206", "207", "208", "209", "210", "212", "213", "214", | ||
"215", "216", "217", "218", "219", "224", "225", "227", "228", "229", "231", "234","239", "240", "248", | ||
"251", "252", "253", "254", "256", "260", "262", "267", "269", "270", "272", "274", "276", "278", "281", | ||
"283", "301", "302", "303", "304", "305", "307", "308", "309", "310", "312", "313", "314", "315", "316", | ||
"317", "318", "319", "320", "321", "323", "325", "327", "330", "331", "334", "336", "337", "339", "341", | ||
"346", "347", "351", "352", "360", "361", "364", "369", "380", "385", "386", "401", "402", "404", "405", | ||
"406", "407", "408", "409", "410", "412", "413", "414", "415", "417", "419", "423", "424", "425", "430", | ||
"432", "434", "435", "440", "442", "443", "445", "447", "458", "464", "469", "470", "475", "478", "479", | ||
"480", "484", "501", "502", "503", "504", "505", "507", "508", "509", "510", "512", "513", "515", "516", | ||
"517", "518", "520", "530", "531", "534", "539", "540", "541", "551", "557", "559", "561", "562", "563", | ||
"564", "567", "570", "571", "573", "574", "575", "580", "582", "585", "586", "601", "602", "603", "605", | ||
"606", "607", "608", "609", "610", "612", "614", "615", "616", "617", "618", "619", "620", "623", "626", | ||
"627", "628", "630", "631", "636", "641", "646", "650", "651", "657", "659", "660", "661", "662", "667", | ||
"669", "678", "679", "681", "682", "689", "701", "702", "703", "704", "706", "707", "708", "712", "713", | ||
"714", "715", "716", "717", "718", "719", "720", "724", "725", "727", "730", "731", "732", "734", "737", | ||
"740", "747", "752", "754", "757", "760", "762", "763", "764", "765", "769", "770", "772", "773", "774", | ||
"775", "779", "781", "785", "786", "801", "802", "803", "804", "805", "806", "808", "810", "812", "813", | ||
"814", "815", "816", "817", "818", "828", "830", "831", "832", "835", "843", "845", "847", "848", "850", | ||
"856", "857", "858", "859", "860", "862", "863", "864", "865", "870", "872", "878", "901", "903", "904", | ||
"906", "907", "908", "909", "910", "912", "913", "914", "915", "916", "917", "918", "919", "920", "925", | ||
"927", "928", "929", "931", "935", "936", "937", "938", "940", "941", "947", "949", "951", "952", "954", | ||
"956", "957", "959", "970", "971", "972", "973", "975", "978", "979", "980", "984", "985", "989"]}, | ||
{"alpha2": "UZ", "alpha3": "UZB", "country_code": "998", "phone_number_lengths": [9], "mobile_begin_with": ["9"]}, | ||
{"alpha2": "VA", "alpha3": "VAT", "country_code": "39", "phone_number_lengths": [], "mobile_begin_with": []}, | ||
{"alpha2": "VC", "alpha3": "VCT", "country_code": "1", "phone_number_lengths": [7], "mobile_begin_with": []}, | ||
{"alpha2": "VE", "alpha3": "VEN", "country_code": "58", "phone_number_lengths": [10], "mobile_begin_with": ["4"]}, | ||
{"alpha2": "VG", "alpha3": "VGB", "country_code": "1", "phone_number_lengths": [7], "mobile_begin_with": []}, | ||
{"alpha2": "VI", "alpha3": "VIR", "country_code": "1", "phone_number_lengths": [7], "mobile_begin_with": []}, | ||
{"alpha2": "VN", "alpha3": "VNM", "country_code": "84", "phone_number_lengths": [9, 10], "mobile_begin_with": ["9", "1"]}, | ||
{"alpha2": "VU", "alpha3": "VUT", "country_code": "678", "phone_number_lengths": [7], "mobile_begin_with": ["5", "7"]}, | ||
{"alpha2": "WF", "alpha3": "WLF", "country_code": "681", "phone_number_lengths": [6], "mobile_begin_with": []}, | ||
{"alpha2": "WS", "alpha3": "WSM", "country_code": "685", "phone_number_lengths": [7], "mobile_begin_with": ["7"]}, | ||
{"alpha2": "YE", "alpha3": "YEM", "country_code": "967", "phone_number_lengths": [9], "mobile_begin_with": ["7"]}, | ||
{"alpha2": "ZA", "alpha3": "ZAF", "country_code": "27", "phone_number_lengths": [9], "mobile_begin_with": ["6", "7", "8"]}, | ||
{"alpha2": "ZM", "alpha3": "ZMB", "country_code": "260", "phone_number_lengths": [9], "mobile_begin_with": ["9"]}, | ||
{"alpha2": "ZW", "alpha3": "ZWE", "country_code": "263", "phone_number_lengths": [9], "mobile_begin_with": ["71", "73", "77"]} | ||
{alpha2: "US", alpha3: "USA", country_code: "1", country_name: "United States", | ||
mobile_begin_with: ["201", "202", "203", "205", "206", "207", "208", "209", "210", "212", "213", "214", "215", | ||
"216", "217", "218", "219", "224", "225", "227", "228", "229", "231", "234", "239", "240", "248", "251", | ||
"252", "253", "254", "256", "260", "262", "267", "269", "270", "272", "274", "276", "278", "281", "283", | ||
"301", "302", "303", "304", "305", "307", "308", "309", "310", "312", "313", "314", "315", "316", "317", | ||
"318", "319", "320", "321", "323", "325", "327", "330", "331", "334", "336", "337", "339", "341", "346", | ||
"347", "351", "352", "360", "361", "364", "369", "380", "385", "386", "401", "402", "404", "405", "406", | ||
"407", "408", "409", "410", "412", "413", "414", "415", "417", "419", "423", "424", "425", "430", "432", | ||
"434", "435", "440", "442", "443", "445", "447", "458", "464", "469", "470", "475", "478", "479", "480", | ||
"484", "501", "502", "503", "504", "505", "507", "508", "509", "510", "512", "513", "515", "516", "517", | ||
"518", "520", "530", "531", "534", "539", "540", "541", "551", "557", "559", "561", "562", "563", "564", | ||
"567", "570", "571", "573", "574", "575", "580", "582", "585", "586", "601", "602", "603", "605", "606", | ||
"607", "608", "609", "610", "612", "614", "615", "616", "617", "618", "619", "620", "623", "626", "627", | ||
"628", "630", "631", "636", "641", "646", "650", "651", "657", "659", "660", "661", "662", "667", "669", | ||
"678", "679", "681", "682", "689", "701", "702", "703", "704", "706", "707", "708", "712", "713", "714", | ||
"715", "716", "717", "718", "719", "720", "724", "725", "727", "730", "731", "732", "734", "737", "740", | ||
"747", "752", "754", "757", "760", "762", "763", "764", "765", "769", "770", "772", "773", "774", "775", | ||
"779", "781", "785", "786", "801", "802", "803", "804", "805", "806", "808", "810", "812", "813", "814", | ||
"815", "816", "817", "818", "828", "830", "831", "832", "835", "843", "845", "847", "848", "850", "856", | ||
"857", "858", "859", "860", "862", "863", "864", "865", "870", "872", "878", "901", "903", "904", "906", | ||
"907", "908", "909", "910", "912", "913", "914", "915", "916", "917", "918", "919", "920", "925", "927", | ||
"928", "929", "931", "935", "936", "937", "938", "940", "941", "947", "949", "951", "952", "954", "956", | ||
"957", "959", "970", "971", "972", "973", "975", "978", "979", "980", "984", "985", "989"], phone_number_lengths: [10]}, | ||
{alpha2: "AW", alpha3: "ABW", country_code: "297", country_name: "Aruba", mobile_begin_with: ["5", "6", "7", "9"], phone_number_lengths: [7]}, | ||
{alpha2: "AF", alpha3: "AFG", country_code: "93", country_name: "Afghanistan", mobile_begin_with: ["7"], phone_number_lengths: [9]}, | ||
{alpha2: "AO", alpha3: "AGO", country_code: "244", country_name: "Angola", mobile_begin_with: ["9"], phone_number_lengths: [9]}, | ||
{alpha2: "AI", alpha3: "AIA", country_code: "1", country_name: "Anguilla", mobile_begin_with: ["5", "7"], phone_number_lengths: [7]}, | ||
{alpha2: "AX", alpha3: "ALA", country_code: "358", country_name: "Åland Islands", mobile_begin_with: ["18"], phone_number_lengths: [6, 7, 8]}, | ||
{alpha2: "AL", alpha3: "ALB", country_code: "355", country_name: "Albania", mobile_begin_with: ["6"], phone_number_lengths: [8]}, | ||
{alpha2: "AD", alpha3: "AND", country_code: "376", country_name: "Andorra", mobile_begin_with: ["3", "4", "6"], phone_number_lengths: [6]}, | ||
//{alpha2: "AN", alpha3: "ANT", country_code: "599", country_name: "Netherlands Antilles", mobile_begin_with: [], phone_number_lengths: []}, | ||
{alpha2: "AE", alpha3: "ARE", country_code: "971", country_name: "United Arab Emirates", mobile_begin_with: ["5"], phone_number_lengths: [9]}, | ||
{alpha2: "AR", alpha3: "ARG", country_code: "54", country_name: "Argentina", mobile_begin_with: [], phone_number_lengths: [10]}, | ||
{alpha2: "AM", alpha3: "ARM", country_code: "374", country_name: "Armenia", mobile_begin_with: ["5", "7", "9"], phone_number_lengths: [8]}, | ||
{alpha2: "AS", alpha3: "ASM", country_code: "1", country_name: "American Samoa", mobile_begin_with: ["733", "258"], phone_number_lengths: [7]}, | ||
//{alpha2: "AQ", alpha3: "ATA", country_code: "672", country_name: "Antarctica", mobile_begin_with: [], phone_number_lengths: []}, | ||
//{alpha2: "TF", alpha3: "ATF", country_code: "", country_name: "French Southern Territories", mobile_begin_with: [], phone_number_lengths: []}, | ||
{alpha2: "AG", alpha3: "ATG", country_code: "1", country_name: "Antigua and Barbuda", mobile_begin_with: ["4", "7"], phone_number_lengths: [7]}, | ||
{alpha2: "AU", alpha3: "AUS", country_code: "61", country_name: "Australia", mobile_begin_with: ["4"], phone_number_lengths: [9]}, | ||
{alpha2: "AT", alpha3: "AUT", country_code: "43", country_name: "Austria", mobile_begin_with: ["6"], phone_number_lengths: [10]}, | ||
{alpha2: "AZ", alpha3: "AZE", country_code: "994", country_name: "Azerbaijan", mobile_begin_with: ["4", "5", "6", "7"], phone_number_lengths: [9]}, | ||
{alpha2: "BI", alpha3: "BDI", country_code: "257", country_name: "Burundi", mobile_begin_with: ["7", "29"], phone_number_lengths: [8]}, | ||
{alpha2: "BE", alpha3: "BEL", country_code: "32", country_name: "Belgium", mobile_begin_with: ["4"], phone_number_lengths: [9]}, | ||
{alpha2: "BJ", alpha3: "BEN", country_code: "229", country_name: "Benin", mobile_begin_with: ["9"], phone_number_lengths: [8]}, | ||
{alpha2: "BF", alpha3: "BFA", country_code: "226", country_name: "Burkina Faso", mobile_begin_with: ["6", "7"], phone_number_lengths: [8]}, | ||
{alpha2: "BD", alpha3: "BGD", country_code: "880", country_name: "Bangladesh", mobile_begin_with: ["1"], phone_number_lengths: [8, 9, 10]}, | ||
{alpha2: "BG", alpha3: "BGR", country_code: "359", country_name: "Bulgaria", mobile_begin_with: ["87", "88", "89", "98", "99", "43"], phone_number_lengths: [8, 9]}, | ||
{alpha2: "BH", alpha3: "BHR", country_code: "973", country_name: "Bahrain", mobile_begin_with: ["3"], phone_number_lengths: [8]}, | ||
{alpha2: "BS", alpha3: "BHS", country_code: "1", country_name: "Bahamas", mobile_begin_with: ["3", "4", "5", "6", "7"], phone_number_lengths: [7]}, | ||
{alpha2: "BA", alpha3: "BIH", country_code: "387", country_name: "Bosnia and Herzegovina", mobile_begin_with: ["6"], phone_number_lengths: [8]}, | ||
//{alpha2: "BL", alpha3: "BLM", country_code: "590", country_name: "Saint Barthélemy", mobile_begin_with: [], phone_number_lengths: []}, | ||
{alpha2: "BY", alpha3: "BLR", country_code: "375", country_name: "Belarus", mobile_begin_with: ["25", "29", "33", "44"], phone_number_lengths: [9]}, | ||
{alpha2: "BZ", alpha3: "BLZ", country_code: "501", country_name: "Belize", mobile_begin_with: ["6"], phone_number_lengths: [7]}, | ||
{alpha2: "BM", alpha3: "BMU", country_code: "1", country_name: "Bermuda", mobile_begin_with: ["3", "5", "7"], phone_number_lengths: [7]}, | ||
{alpha2: "BO", alpha3: "BOL", country_code: "591", country_name: "Bolivia", mobile_begin_with: ["7"], phone_number_lengths: [8]}, | ||
{alpha2: "BR", alpha3: "BRA", country_code: "55", country_name: "Brazil", mobile_begin_with: [ | ||
"119", "129", "139", "149", "159", "169", "179", "189", "199", "219", "229", "249", "279", "289", "31", "32", | ||
"34", "38", "41", "43", "44", "45", "47", "48", "51", "53", "54", "55", "61", "62", "65", "67", "68", "69", | ||
"71", "73", "75", "77", "79", "81", "82", "83", "84", "85", "86", "91", "92", "95", "96", "98" | ||
], phone_number_lengths: [10, 11]}, | ||
{alpha2: "BB", alpha3: "BRB", country_code: "1", country_name: "Barbados", mobile_begin_with: [], phone_number_lengths: [7]}, | ||
{alpha2: "BN", alpha3: "BRN", country_code: "673", country_name: "Brunei Darussalam", mobile_begin_with: ["7", "8"], phone_number_lengths: [7]}, | ||
{alpha2: "BT", alpha3: "BTN", country_code: "975", country_name: "Bhutan", mobile_begin_with: ["17"], phone_number_lengths: [8]}, | ||
//{alpha2: "BV", alpha3: "BVT", country_code: "", country_name: "Bouvet Island", mobile_begin_with: [], phone_number_lengths: []}, | ||
{alpha2: "BW", alpha3: "BWA", country_code: "267", country_name: "Botswana", mobile_begin_with: ["71", "72", "73", "74", "75", "76"], phone_number_lengths: [8]}, | ||
{alpha2: "CF", alpha3: "CAF", country_code: "236", country_name: "Central African Republic", mobile_begin_with: ["7"], phone_number_lengths: [8]}, | ||
// http://www.howtocallabroad.com/canada/ | ||
// http://areacode.org/ | ||
// http://countrycode.org/canada | ||
{alpha2: "CA", alpha3: "CAN", country_code: "1", country_name: "Canada", | ||
mobile_begin_with: ["204", "226", "236", "249", "250", "289", "306", "343", "365", "403", "416", "418", "431", | ||
"437", "438", "450", "506", "514", "519", "579", "581", "587", "600", "604", "613", "639", "647", "705", | ||
"709", "778", "780", "807", "819", "867", "873", "902", "905"], phone_number_lengths: [10]}, | ||
//{alpha2: "CC", alpha3: "CCK", country_code: "61", country_name: "Cocos (Keeling) Islands", mobile_begin_with: [], phone_number_lengths: []}, | ||
{alpha2: "CH", alpha3: "CHE", country_code: "41", country_name: "Switzerland", mobile_begin_with: ["7"], phone_number_lengths: [9]}, | ||
{alpha2: "CL", alpha3: "CHL", country_code: "56", country_name: "Chile", mobile_begin_with: ["9"], phone_number_lengths: [9]}, | ||
{alpha2: "CN", alpha3: "CHN", country_code: "86", country_name: "China", mobile_begin_with: ["13", "14", "15", "18"], phone_number_lengths: [11]}, | ||
{alpha2: "CI", alpha3: "CIV", country_code: "225", country_name: "Côte D'Ivoire", mobile_begin_with: ["0", "4", "5", "6"], phone_number_lengths: [8]}, | ||
{alpha2: "CM", alpha3: "CMR", country_code: "237", country_name: "Cameroon", mobile_begin_with: ["7", "9"], phone_number_lengths: [8]}, | ||
{alpha2: "CD", alpha3: "COD", country_code: "243", country_name: "Congo, The Democratic Republic Of The", mobile_begin_with: ["8", "9"], phone_number_lengths: [9]}, | ||
{alpha2: "CG", alpha3: "COG", country_code: "242", country_name: "Congo", mobile_begin_with: ["0"], phone_number_lengths: [9]}, | ||
{alpha2: "CK", alpha3: "COK", country_code: "682", country_name: "Cook Islands", mobile_begin_with: ["5", "7"], phone_number_lengths: [5]}, | ||
{alpha2: "CO", alpha3: "COL", country_code: "57", country_name: "Colombia", mobile_begin_with: ["3"], phone_number_lengths: [10]}, | ||
{alpha2: "KM", alpha3: "COM", country_code: "269", country_name: "Comoros", mobile_begin_with: ["3", "76"], phone_number_lengths: [7]}, | ||
{alpha2: "CV", alpha3: "CPV", country_code: "238", country_name: "Cape Verde", mobile_begin_with: ["5", "9"], phone_number_lengths: [7]}, | ||
{alpha2: "CR", alpha3: "CRI", country_code: "506", country_name: "Costa Rica", mobile_begin_with: ["5", "6", "7", "8"], phone_number_lengths: [8]}, | ||
{alpha2: "CU", alpha3: "CUB", country_code: "53", country_name: "Cuba", mobile_begin_with: ["5"], phone_number_lengths: [8]}, | ||
//{alpha2: "CX", alpha3: "CXR", country_code: "61", country_name: "Christmas Island", mobile_begin_with: [], phone_number_lengths: []}, | ||
{alpha2: "KY", alpha3: "CYM", country_code: "1", country_name: "Cayman Islands", mobile_begin_with: ["345"], phone_number_lengths: [10]}, | ||
{alpha2: "CY", alpha3: "CYP", country_code: "357", country_name: "Cyprus", mobile_begin_with: ["9"], phone_number_lengths: [8]}, | ||
{alpha2: "CZ", alpha3: "CZE", country_code: "420", country_name: "Czech Republic", mobile_begin_with: ["6", "7"], phone_number_lengths: [9]}, | ||
{alpha2: "DE", alpha3: "DEU", country_code: "49", country_name: "Germany", mobile_begin_with: ["15", "16", "17"], phone_number_lengths: [10, 11]}, | ||
{alpha2: "DJ", alpha3: "DJI", country_code: "253", country_name: "Djibouti", mobile_begin_with: ["77"], phone_number_lengths: [8]}, | ||
{alpha2: "DM", alpha3: "DMA", country_code: "1", country_name: "Dominica", mobile_begin_with: [], phone_number_lengths: [7]}, | ||
{alpha2: "DK", alpha3: "DNK", country_code: "45", country_name: "Denmark", mobile_begin_with: [], phone_number_lengths: [8]}, | ||
{alpha2: "DO", alpha3: "DOM", country_code: "1", country_name: "Dominican Republic", mobile_begin_with: ["809", "829", "849"], phone_number_lengths: [10]}, | ||
{alpha2: "DZ", alpha3: "DZA", country_code: "213", country_name: "Algeria", mobile_begin_with: ["5", "6", "7"], phone_number_lengths: [9]}, | ||
{alpha2: "EC", alpha3: "ECU", country_code: "593", country_name: "Ecuador", mobile_begin_with: ["9"], phone_number_lengths: [9]}, | ||
{alpha2: "EG", alpha3: "EGY", country_code: "20", country_name: "Egypt", mobile_begin_with: ["1"], phone_number_lengths: [10]}, | ||
{alpha2: "ER", alpha3: "ERI", country_code: "291", country_name: "Eritrea", mobile_begin_with: ["1", "7", "8"], phone_number_lengths: [7]}, | ||
//{alpha2: "EH", alpha3: "ESH", country_code: "212", country_name: "Western Sahara", mobile_begin_with: [], phone_number_lengths: []}, | ||
{alpha2: "ES", alpha3: "ESP", country_code: "34", country_name: "Spain", mobile_begin_with: ["6", "7"], phone_number_lengths: [9]}, | ||
{alpha2: "EE", alpha3: "EST", country_code: "372", country_name: "Estonia", mobile_begin_with: ["5"], phone_number_lengths: [8]}, | ||
{alpha2: "ET", alpha3: "ETH", country_code: "251", country_name: "Ethiopia", mobile_begin_with: ["9"], phone_number_lengths: [9]}, | ||
{alpha2: "FI", alpha3: "FIN", country_code: "358", country_name: "Finland", mobile_begin_with: ["4", "5"], phone_number_lengths: [9]}, | ||
{alpha2: "FJ", alpha3: "FJI", country_code: "679", country_name: "Fiji", mobile_begin_with: ["7", "9"], phone_number_lengths: [7]}, | ||
{alpha2: "FK", alpha3: "FLK", country_code: "500", country_name: "Falkland Islands (Malvinas)", mobile_begin_with: ["5", "6"], phone_number_lengths: [5]}, | ||
{alpha2: "FR", alpha3: "FRA", country_code: "33", country_name: "France", mobile_begin_with: ["6", "7"], phone_number_lengths: [9]}, | ||
{alpha2: "FO", alpha3: "FRO", country_code: "298", country_name: "Faroe Islands", mobile_begin_with: [], phone_number_lengths: [6]}, | ||
{alpha2: "FM", alpha3: "FSM", country_code: "691", country_name: "Micronesia, Federated States Of", mobile_begin_with: [], phone_number_lengths: [7]}, | ||
{alpha2: "GA", alpha3: "GAB", country_code: "241", country_name: "Gabon", mobile_begin_with: ["05", "06", "07"], phone_number_lengths: [8]}, | ||
{alpha2: "GB", alpha3: "GBR", country_code: "44", country_name: "United Kingdom", mobile_begin_with: ["7"], phone_number_lengths: [10]}, | ||
{alpha2: "GE", alpha3: "GEO", country_code: "995", country_name: "Georgia", mobile_begin_with: ["5", "7"], phone_number_lengths: [9]}, | ||
//{alpha2: "GG", alpha3: "GGY", country_code: "44", country_name: "Guernsey", mobile_begin_with: [], phone_number_lengths: []}, | ||
{alpha2: "GH", alpha3: "GHA", country_code: "233", country_name: "Ghana", mobile_begin_with: ["2", "5"], phone_number_lengths: [9]}, | ||
{alpha2: "GI", alpha3: "GIB", country_code: "350", country_name: "Gibraltar", mobile_begin_with: ["5"], phone_number_lengths: [8]}, | ||
{alpha2: "GN", alpha3: "GIN", country_code: "224", country_name: "Guinea", mobile_begin_with: ["6"], phone_number_lengths: [8]}, | ||
{alpha2: "GP", alpha3: "GLP", country_code: "590", country_name: "Guadeloupe", mobile_begin_with: ["690"], phone_number_lengths: [9]}, | ||
{alpha2: "GM", alpha3: "GMB", country_code: "220", country_name: "Gambia", mobile_begin_with: ["7", "9"], phone_number_lengths: [7]}, | ||
{alpha2: "GW", alpha3: "GNB", country_code: "245", country_name: "Guinea-Bissau", mobile_begin_with: ["5", "6", "7"], phone_number_lengths: [7]}, | ||
{alpha2: "GQ", alpha3: "GNQ", country_code: "240", country_name: "Equatorial Guinea", mobile_begin_with: ["222", "551"], phone_number_lengths: [9]}, | ||
{alpha2: "GR", alpha3: "GRC", country_code: "30", country_name: "Greece", mobile_begin_with: ["6"], phone_number_lengths: [10]}, | ||
{alpha2: "GD", alpha3: "GRD", country_code: "1", country_name: "Grenada", mobile_begin_with: [], phone_number_lengths: [7]}, | ||
{alpha2: "GL", alpha3: "GRL", country_code: "299", country_name: "Greenland", mobile_begin_with: ["4", "5"], phone_number_lengths: [6]}, | ||
{alpha2: "GT", alpha3: "GTM", country_code: "502", country_name: "Guatemala", mobile_begin_with: ["3", "4", "5"], phone_number_lengths: [8]}, | ||
{alpha2: "GF", alpha3: "GUF", country_code: "594", country_name: "French Guiana", mobile_begin_with: ["694"], phone_number_lengths: [9]}, | ||
{alpha2: "GU", alpha3: "GUM", country_code: "1", country_name: "Guam", mobile_begin_with: [], phone_number_lengths: [7]}, | ||
{alpha2: "GY", alpha3: "GUY", country_code: "592", country_name: "Guyana", mobile_begin_with: ["6"], phone_number_lengths: [7]}, | ||
{alpha2: "HK", alpha3: "HKG", country_code: "852", country_name: "Hong Kong", mobile_begin_with: ["5", "6", "9"], phone_number_lengths: [8]}, | ||
//{alpha2: "HM", alpha3: "HMD", country_code: "", country_name: "Heard and McDonald Islands", mobile_begin_with: [], phone_number_lengths: []}, | ||
{alpha2: "HN", alpha3: "HND", country_code: "504", country_name: "Honduras", mobile_begin_with: ["3", "7", "8", "9"], phone_number_lengths: [8]}, | ||
{alpha2: "HR", alpha3: "HRV", country_code: "385", country_name: "Croatia", mobile_begin_with: ["9"], phone_number_lengths: [9]}, | ||
{alpha2: "HT", alpha3: "HTI", country_code: "509", country_name: "Haiti", mobile_begin_with: ["3", "4"], phone_number_lengths: [8]}, | ||
{alpha2: "HU", alpha3: "HUN", country_code: "36", country_name: "Hungary", mobile_begin_with: ["20", "30", "31", "70"], phone_number_lengths: [9]}, | ||
{alpha2: "ID", alpha3: "IDN", country_code: "62", country_name: "Indonesia", mobile_begin_with: ["8"], phone_number_lengths: [9, 10, 11]}, | ||
//{alpha2: "IM", alpha3: "IMN", country_code: "44", country_name: "Isle of Man", mobile_begin_with: [], phone_number_lengths: []}, | ||
{alpha2: "IN", alpha3: "IND", country_code: "91", country_name: "India", mobile_begin_with: ["7", "8", "9"], phone_number_lengths: [10]}, | ||
//{alpha2: "IO", alpha3: "IOT", country_code: "246", country_name: "British Indian Ocean Territory", mobile_begin_with: [], phone_number_lengths: []}, | ||
{alpha2: "IE", alpha3: "IRL", country_code: "353", country_name: "Ireland", mobile_begin_with: ["82", "83", "84", "85", "86", "87", "88", "89"], phone_number_lengths: [9]}, | ||
{alpha2: "IR", alpha3: "IRN", country_code: "98", country_name: "Iran, Islamic Republic Of", mobile_begin_with: ["9"], phone_number_lengths: [10]}, | ||
{alpha2: "IQ", alpha3: "IRQ", country_code: "964", country_name: "Iraq", mobile_begin_with: ["7"], phone_number_lengths: [10]}, | ||
{alpha2: "IS", alpha3: "ISL", country_code: "354", country_name: "Iceland", mobile_begin_with: ["6", "7", "8"], phone_number_lengths: [7]}, | ||
{alpha2: "IL", alpha3: "ISR", country_code: "972", country_name: "Israel", mobile_begin_with: ["5"], phone_number_lengths: [9]}, | ||
{alpha2: "IT", alpha3: "ITA", country_code: "39", country_name: "Italy", mobile_begin_with: ["3"], phone_number_lengths: [10]}, | ||
{alpha2: "JM", alpha3: "JAM", country_code: "1", country_name: "Jamaica", mobile_begin_with: [], phone_number_lengths: [7]}, | ||
//{alpha2: "JE", alpha3: "JEY", country_code: "44", country_name: "Jersey", mobile_begin_with: [], phone_number_lengths: []}, | ||
{alpha2: "JO", alpha3: "JOR", country_code: "962", country_name: "Jordan", mobile_begin_with: ["7"], phone_number_lengths: [9]}, | ||
{alpha2: "JP", alpha3: "JPN", country_code: "81", country_name: "Japan", mobile_begin_with: ["70", "80", "90"], phone_number_lengths: [10]}, | ||
{alpha2: "KZ", alpha3: "KAZ", country_code: "7", country_name: "Kazakhstan", mobile_begin_with: ["70", "77"], phone_number_lengths: [10]}, | ||
{alpha2: "KE", alpha3: "KEN", country_code: "254", country_name: "Kenya", mobile_begin_with: ["7"], phone_number_lengths: [9]}, | ||
{alpha2: "KG", alpha3: "KGZ", country_code: "996", country_name: "Kyrgyzstan", mobile_begin_with: ["5", "7"], phone_number_lengths: [9]}, | ||
{alpha2: "KH", alpha3: "KHM", country_code: "855", country_name: "Cambodia", mobile_begin_with: ["1", "6", "7", "8", "9"], phone_number_lengths: [8, 9]}, | ||
{alpha2: "KI", alpha3: "KIR", country_code: "686", country_name: "Kiribati", mobile_begin_with: ["9", "30"], phone_number_lengths: [5]}, | ||
{alpha2: "KN", alpha3: "KNA", country_code: "1", country_name: "Saint Kitts And Nevis", mobile_begin_with: [], phone_number_lengths: [7]}, | ||
{alpha2: "KR", alpha3: "KOR", country_code: "82", country_name: "Korea, Republic of", mobile_begin_with: ["1"], phone_number_lengths: [9, 10]}, | ||
{alpha2: "KW", alpha3: "KWT", country_code: "965", country_name: "Kuwait", mobile_begin_with: ["5", "6", "9"], phone_number_lengths: [8]}, | ||
{alpha2: "LA", alpha3: "LAO", country_code: "856", country_name: "Lao People's Democratic Republic", mobile_begin_with: ["20"], phone_number_lengths: [10]}, | ||
{alpha2: "LB", alpha3: "LBN", country_code: "961", country_name: "Lebanon", mobile_begin_with: ["3", "7"], phone_number_lengths: [7, 8]}, | ||
{alpha2: "LR", alpha3: "LBR", country_code: "231", country_name: "Liberia", mobile_begin_with: ["4", "5", "6", "7"], phone_number_lengths: [7, 8]}, | ||
{alpha2: "LY", alpha3: "LBY", country_code: "218", country_name: "Libyan Arab Jamahiriya", mobile_begin_with: ["9"], phone_number_lengths: [9]}, | ||
{alpha2: "LC", alpha3: "LCA", country_code: "1", country_name: "Saint Lucia", mobile_begin_with: [], phone_number_lengths: [7]}, | ||
{alpha2: "LI", alpha3: "LIE", country_code: "423", country_name: "Liechtenstein", mobile_begin_with: ["7"], phone_number_lengths: [7]}, | ||
{alpha2: "LK", alpha3: "LKA", country_code: "94", country_name: "Sri Lanka", mobile_begin_with: ["7"], phone_number_lengths: [9]}, | ||
{alpha2: "LS", alpha3: "LSO", country_code: "266", country_name: "Lesotho", mobile_begin_with: ["5", "6"], phone_number_lengths: [8]}, | ||
{alpha2: "LT", alpha3: "LTU", country_code: "370", country_name: "Lithuania", mobile_begin_with: ["6"], phone_number_lengths: [8]}, | ||
{alpha2: "LU", alpha3: "LUX", country_code: "352", country_name: "Luxembourg", mobile_begin_with: ["6"], phone_number_lengths: [9]}, | ||
{alpha2: "LV", alpha3: "LVA", country_code: "371", country_name: "Latvia", mobile_begin_with: ["2"], phone_number_lengths: [8]}, | ||
{alpha2: "MO", alpha3: "MAC", country_code: "853", country_name: "Macao", mobile_begin_with: ["6"], phone_number_lengths: [8]}, | ||
//{alpha2: "MF", alpha3: "MAF", country_code: "590", country_name: "Saint Martin", mobile_begin_with: [], phone_number_lengths: []}, | ||
{alpha2: "MA", alpha3: "MAR", country_code: "212", country_name: "Morocco", mobile_begin_with: ["6"], phone_number_lengths: [9]}, | ||
{alpha2: "MC", alpha3: "MCO", country_code: "377", country_name: "Monaco", mobile_begin_with: ["4", "6"], phone_number_lengths: [8, 9]}, | ||
{alpha2: "MD", alpha3: "MDA", country_code: "373", country_name: "Moldova, Republic of", mobile_begin_with: ["6", "7"], phone_number_lengths: [8]}, | ||
{alpha2: "MG", alpha3: "MDG", country_code: "261", country_name: "Madagascar", mobile_begin_with: ["3"], phone_number_lengths: [9]}, | ||
{alpha2: "MV", alpha3: "MDV", country_code: "960", country_name: "Maldives", mobile_begin_with: ["7", "9"], phone_number_lengths: [7]}, | ||
{alpha2: "MX", alpha3: "MEX", country_code: "52", country_name: "Mexico", mobile_begin_with: [""], phone_number_lengths: [10, 11]}, | ||
{alpha2: "MH", alpha3: "MHL", country_code: "692", country_name: "Marshall Islands", mobile_begin_with: [], phone_number_lengths: [7]}, | ||
{alpha2: "MK", alpha3: "MKD", country_code: "389", country_name: "Macedonia, the Former Yugoslav Republic Of", mobile_begin_with: ["7"], phone_number_lengths: [8]}, | ||
{alpha2: "ML", alpha3: "MLI", country_code: "223", country_name: "Mali", mobile_begin_with: ["6", "7"], phone_number_lengths: [8]}, | ||
{alpha2: "MT", alpha3: "MLT", country_code: "356", country_name: "Malta", mobile_begin_with: ["79", "99"], phone_number_lengths: [8]}, | ||
{alpha2: "MM", alpha3: "MMR", country_code: "95", country_name: "Myanmar", mobile_begin_with: ["9"], phone_number_lengths: [8]}, | ||
{alpha2: "ME", alpha3: "MNE", country_code: "382", country_name: "Montenegro", mobile_begin_with: ["6"], phone_number_lengths: [8]}, | ||
{alpha2: "MN", alpha3: "MNG", country_code: "976", country_name: "Mongolia", mobile_begin_with: ["5", "8", "9"], phone_number_lengths: [8]}, | ||
{alpha2: "MP", alpha3: "MNP", country_code: "1", country_name: "Northern Mariana Islands", mobile_begin_with: [], phone_number_lengths: [7]}, | ||
{alpha2: "MZ", alpha3: "MOZ", country_code: "258", country_name: "Mozambique", mobile_begin_with: ["8"], phone_number_lengths: [9]}, | ||
{alpha2: "MR", alpha3: "MRT", country_code: "222", country_name: "Mauritania", mobile_begin_with: [], phone_number_lengths: [8]}, | ||
{alpha2: "MS", alpha3: "MSR", country_code: "1", country_name: "Montserrat", mobile_begin_with: [], phone_number_lengths: [7]}, | ||
{alpha2: "MQ", alpha3: "MTQ", country_code: "596", country_name: "Martinique", mobile_begin_with: ["696"], phone_number_lengths: [9]}, | ||
{alpha2: "MU", alpha3: "MUS", country_code: "230", country_name: "Mauritius", mobile_begin_with: [], phone_number_lengths: [7]}, | ||
{alpha2: "MW", alpha3: "MWI", country_code: "265", country_name: "Malawi", mobile_begin_with: ["77", "88", "99"], phone_number_lengths: [9]}, | ||
{alpha2: "MY", alpha3: "MYS", country_code: "60", country_name: "Malaysia", mobile_begin_with: ["1"], phone_number_lengths: [9, 10]}, | ||
{alpha2: "YT", alpha3: "MYT", country_code: "269", country_name: "Mayotte", mobile_begin_with: ["639"], phone_number_lengths: [9]}, | ||
{alpha2: "NA", alpha3: "NAM", country_code: "264", country_name: "Namibia", mobile_begin_with: ["60", "81", "82", "85"], phone_number_lengths: [9]}, | ||
{alpha2: "NC", alpha3: "NCL", country_code: "687", country_name: "New Caledonia", mobile_begin_with: [], phone_number_lengths: [6]}, | ||
{alpha2: "NE", alpha3: "NER", country_code: "227", country_name: "Niger", mobile_begin_with: ["9"], phone_number_lengths: [8]}, | ||
{alpha2: "NF", alpha3: "NFK", country_code: "672", country_name: "Norfolk Island", mobile_begin_with: ["5", "8"], phone_number_lengths: [5]}, | ||
{alpha2: "NG", alpha3: "NGA", country_code: "234", country_name: "Nigeria", mobile_begin_with: ["70", "80", "81"], phone_number_lengths: [10]}, | ||
{alpha2: "NI", alpha3: "NIC", country_code: "505", country_name: "Nicaragua", mobile_begin_with: ["8"], phone_number_lengths: [8]}, | ||
{alpha2: "NU", alpha3: "NIU", country_code: "683", country_name: "Niue", mobile_begin_with: [], phone_number_lengths: [4]}, | ||
{alpha2: "NL", alpha3: "NLD", country_code: "31", country_name: "Netherlands", mobile_begin_with: ["6"], phone_number_lengths: [9]}, | ||
{alpha2: "NO", alpha3: "NOR", country_code: "47", country_name: "Norway", mobile_begin_with: ["4", "9"], phone_number_lengths: [8]}, | ||
{alpha2: "NP", alpha3: "NPL", country_code: "977", country_name: "Nepal", mobile_begin_with: ["97", "98"], phone_number_lengths: [10]}, | ||
{alpha2: "NR", alpha3: "NRU", country_code: "674", country_name: "Nauru", mobile_begin_with: ["555"], phone_number_lengths: [7]}, | ||
{alpha2: "NZ", alpha3: "NZL", country_code: "64", country_name: "New Zealand", mobile_begin_with: ["2"], phone_number_lengths: [8, 9, 10]}, | ||
{alpha2: "OM", alpha3: "OMN", country_code: "968", country_name: "Oman", mobile_begin_with: ["9"], phone_number_lengths: [8]}, | ||
{alpha2: "PK", alpha3: "PAK", country_code: "92", country_name: "Pakistan", mobile_begin_with: ["3"], phone_number_lengths: [10]}, | ||
{alpha2: "PA", alpha3: "PAN", country_code: "507", country_name: "Panama", mobile_begin_with: ["5", "6"], phone_number_lengths: [8]}, | ||
//{alpha2: "PN", alpha3: "PCN", country_code: "", country_name: "Pitcairn", mobile_begin_with: [], phone_number_lengths: []}, | ||
{alpha2: "PE", alpha3: "PER", country_code: "51", country_name: "Peru", mobile_begin_with: ["9"], phone_number_lengths: [9]}, | ||
{alpha2: "PH", alpha3: "PHL", country_code: "63", country_name: "Philippines", mobile_begin_with: ["9"], phone_number_lengths: [10]}, | ||
{alpha2: "PW", alpha3: "PLW", country_code: "680", country_name: "Palau", mobile_begin_with: [], phone_number_lengths: [7]}, | ||
{alpha2: "PG", alpha3: "PNG", country_code: "675", country_name: "Papua New Guinea", mobile_begin_with: ["7"], phone_number_lengths: [8]}, | ||
{alpha2: "PL", alpha3: "POL", country_code: "48", country_name: "Poland", mobile_begin_with: ["5", "6", "7", "8"], phone_number_lengths: [9]}, | ||
{alpha2: "PR", alpha3: "PRI", country_code: "1", country_name: "Puerto Rico", mobile_begin_with: [], phone_number_lengths: [7]}, | ||
//{alpha2: "KP", alpha3: "PRK", country_code: "850", country_name: "Korea, Democratic People's Republic Of", mobile_begin_with: [], phone_number_lengths: []}, | ||
{alpha2: "PT", alpha3: "PRT", country_code: "351", country_name: "Portugal", mobile_begin_with: ["9"], phone_number_lengths: [9]}, | ||
{alpha2: "PY", alpha3: "PRY", country_code: "595", country_name: "Paraguay", mobile_begin_with: ["9"], phone_number_lengths: [9]}, | ||
{alpha2: "PS", alpha3: "PSE", country_code: "970", country_name: "Palestinian Territory, Occupied", mobile_begin_with: ["5"], phone_number_lengths: [9]}, | ||
{alpha2: "PF", alpha3: "PYF", country_code: "689", country_name: "French Polynesia", mobile_begin_with: [], phone_number_lengths: [6]}, | ||
{alpha2: "QA", alpha3: "QAT", country_code: "974", country_name: "Qatar", mobile_begin_with: ["33", "55", "66", "77"], phone_number_lengths: [8]}, | ||
{alpha2: "RE", alpha3: "REU", country_code: "262", country_name: "Réunion", mobile_begin_with: ["692", "693"], phone_number_lengths: [9]}, | ||
{alpha2: "RO", alpha3: "ROU", country_code: "40", country_name: "Romania", mobile_begin_with: ["7"], phone_number_lengths: [9]}, | ||
{alpha2: "RU", alpha3: "RUS", country_code: "7", country_name: "Russian Federation", mobile_begin_with: ["9"], phone_number_lengths: [10]}, | ||
{alpha2: "RW", alpha3: "RWA", country_code: "250", country_name: "Rwanda", mobile_begin_with: ["7"], phone_number_lengths: [9]}, | ||
{alpha2: "SA", alpha3: "SAU", country_code: "966", country_name: "Saudi Arabia", mobile_begin_with: ["5"], phone_number_lengths: [9]}, | ||
{alpha2: "SD", alpha3: "SDN", country_code: "249", country_name: "Sudan", mobile_begin_with: ["9"], phone_number_lengths: [9]}, | ||
{alpha2: "SN", alpha3: "SEN", country_code: "221", country_name: "Senegal", mobile_begin_with: ["7"], phone_number_lengths: [9]}, | ||
{alpha2: "SG", alpha3: "SGP", country_code: "65", country_name: "Singapore", mobile_begin_with: ["8", "9"], phone_number_lengths: [8]}, | ||
//{alpha2: "GS", alpha3: "SGS", country_code: "500", country_name: "South Georgia and the South Sandwich Islands", mobile_begin_with: [], phone_number_lengths: []}, | ||
{alpha2: "SH", alpha3: "SHN", country_code: "290", country_name: "Saint Helena", mobile_begin_with: [], phone_number_lengths: [4]}, | ||
{alpha2: "SJ", alpha3: "SJM", country_code: "47", country_name: "Svalbard And Jan Mayen", mobile_begin_with: [], phone_number_lengths: [8]}, | ||
{alpha2: "SB", alpha3: "SLB", country_code: "677", country_name: "Solomon Islands", mobile_begin_with: ["7", "8"], phone_number_lengths: [7]}, | ||
{alpha2: "SL", alpha3: "SLE", country_code: "232", country_name: "Sierra Leone", mobile_begin_with: ["21", "25", "30", "33", "34", "40", "44", "50", "55", "76", "77", "78", "79", "88"], phone_number_lengths: [8]}, | ||
{alpha2: "SV", alpha3: "SLV", country_code: "503", country_name: "El Salvador", mobile_begin_with: ["7"], phone_number_lengths: [8]}, | ||
{alpha2: "SM", alpha3: "SMR", country_code: "378", country_name: "San Marino", mobile_begin_with: ["3", "6"], phone_number_lengths: [10]}, | ||
{alpha2: "SO", alpha3: "SOM", country_code: "252", country_name: "Somalia", mobile_begin_with: ["9"], phone_number_lengths: [8]}, | ||
{alpha2: "PM", alpha3: "SPM", country_code: "508", country_name: "Saint Pierre And Miquelon", mobile_begin_with: ["55"], phone_number_lengths: [6]}, | ||
{alpha2: "RS", alpha3: "SRB", country_code: "381", country_name: "Serbia", mobile_begin_with: ["6"], phone_number_lengths: [8, 9]}, | ||
{alpha2: "ST", alpha3: "STP", country_code: "239", country_name: "Sao Tome and Principe", mobile_begin_with: ["98", "99"], phone_number_lengths: [7]}, | ||
{alpha2: "SR", alpha3: "SUR", country_code: "597", country_name: "Suriname", mobile_begin_with: ["6", "7", "8"], phone_number_lengths: [7]}, | ||
{alpha2: "SK", alpha3: "SVK", country_code: "421", country_name: "Slovakia", mobile_begin_with: ["9"], phone_number_lengths: [9]}, | ||
{alpha2: "SI", alpha3: "SVN", country_code: "386", country_name: "Slovenia", mobile_begin_with: ["3", "4", "5", "6", "7"], phone_number_lengths: [8]}, | ||
{alpha2: "SE", alpha3: "SWE", country_code: "46", country_name: "Sweden", mobile_begin_with: ["7"], phone_number_lengths: [9]}, | ||
//{alpha2: "SZ", alpha3: "SWZ", country_code: "268", country_name: "Swaziland", mobile_begin_with: [], phone_number_lengths: []}, | ||
{alpha2: "SC", alpha3: "SYC", country_code: "248", country_name: "Seychelles", mobile_begin_with: ["2"], phone_number_lengths: [7]}, | ||
{alpha2: "SY", alpha3: "SYR", country_code: "963", country_name: "Syrian Arab Republic", mobile_begin_with: ["9"], phone_number_lengths: [9]}, | ||
{alpha2: "TC", alpha3: "TCA", country_code: "1", country_name: "Turks and Caicos Islands", mobile_begin_with: ["2", "3", "4"], phone_number_lengths: [7]}, | ||
{alpha2: "TD", alpha3: "TCD", country_code: "235", country_name: "Chad", mobile_begin_with: ["6", "7", "9"], phone_number_lengths: [8]}, | ||
{alpha2: "TG", alpha3: "TGO", country_code: "228", country_name: "Togo", mobile_begin_with: ["9"], phone_number_lengths: [8]}, | ||
{alpha2: "TH", alpha3: "THA", country_code: "66", country_name: "Thailand", mobile_begin_with: ["8", "9"], phone_number_lengths: [9]}, | ||
{alpha2: "TJ", alpha3: "TJK", country_code: "992", country_name: "Tajikistan", mobile_begin_with: ["9"], phone_number_lengths: [9]}, | ||
{alpha2: "TK", alpha3: "TKL", country_code: "690", country_name: "Tokelau", mobile_begin_with: [], phone_number_lengths: [4]}, | ||
{alpha2: "TM", alpha3: "TKM", country_code: "993", country_name: "Turkmenistan", mobile_begin_with: [], phone_number_lengths: [8]}, | ||
{alpha2: "TL", alpha3: "TLS", country_code: "670", country_name: "Timor-Leste", mobile_begin_with: ["7"], phone_number_lengths: [8]}, | ||
{alpha2: "TO", alpha3: "TON", country_code: "676", country_name: "Tonga", mobile_begin_with: [], phone_number_lengths: [5]}, | ||
{alpha2: "TT", alpha3: "TTO", country_code: "1", country_name: "Trinidad and Tobago", mobile_begin_with: [], phone_number_lengths: [7]}, | ||
{alpha2: "TN", alpha3: "TUN", country_code: "216", country_name: "Tunisia", mobile_begin_with: ["2", "9"], phone_number_lengths: [8]}, | ||
{alpha2: "TR", alpha3: "TUR", country_code: "90", country_name: "Turkey", mobile_begin_with: ["5"], phone_number_lengths: [10]}, | ||
{alpha2: "TV", alpha3: "TUV", country_code: "688", country_name: "Tuvalu", mobile_begin_with: [], phone_number_lengths: [5]}, | ||
{alpha2: "TW", alpha3: "TWN", country_code: "886", country_name: "Taiwan, Province Of China", mobile_begin_with: ["9"], phone_number_lengths: [9]}, | ||
{alpha2: "TZ", alpha3: "TZA", country_code: "255", country_name: "Tanzania, United Republic of", mobile_begin_with: ["7"], phone_number_lengths: [9]}, | ||
{alpha2: "UG", alpha3: "UGA", country_code: "256", country_name: "Uganda", mobile_begin_with: ["7"], phone_number_lengths: [9]}, | ||
{alpha2: "UA", alpha3: "UKR", country_code: "380", country_name: "Ukraine", mobile_begin_with: ["39", "50", "63", "66", "67", "68", "9"], phone_number_lengths: [9]}, | ||
//{alpha2: "UM", alpha3: "UMI", country_code: "", country_name: "United States Minor Outlying Islands", mobile_begin_with: [], phone_number_lengths: []}, | ||
{alpha2: "UY", alpha3: "URY", country_code: "598", country_name: "Uruguay", mobile_begin_with: ["9"], phone_number_lengths: [8]}, | ||
{alpha2: "UZ", alpha3: "UZB", country_code: "998", country_name: "Uzbekistan", mobile_begin_with: ["9"], phone_number_lengths: [9]}, | ||
//{alpha2: "VA", alpha3: "VAT", country_code: "39", country_name: "Holy See (Vatican City State)", mobile_begin_with: [], phone_number_lengths: []}, | ||
{alpha2: "VC", alpha3: "VCT", country_code: "1", country_name: "Saint Vincent And The Grenedines", mobile_begin_with: [], phone_number_lengths: [7]}, | ||
{alpha2: "VE", alpha3: "VEN", country_code: "58", country_name: "Venezuela, Bolivarian Republic of", mobile_begin_with: ["4"], phone_number_lengths: [10]}, | ||
{alpha2: "VG", alpha3: "VGB", country_code: "1", country_name: "Virgin Islands, British", mobile_begin_with: [], phone_number_lengths: [7]}, | ||
{alpha2: "VI", alpha3: "VIR", country_code: "1", country_name: "Virgin Islands, U.S.", mobile_begin_with: [], phone_number_lengths: [7]}, | ||
{alpha2: "VN", alpha3: "VNM", country_code: "84", country_name: "Viet Nam", mobile_begin_with: ["9", "1"], phone_number_lengths: [9, 10]}, | ||
{alpha2: "VU", alpha3: "VUT", country_code: "678", country_name: "Vanuatu", mobile_begin_with: ["5", "7"], phone_number_lengths: [7]}, | ||
{alpha2: "WF", alpha3: "WLF", country_code: "681", country_name: "Wallis and Futuna", mobile_begin_with: [], phone_number_lengths: [6]}, | ||
{alpha2: "WS", alpha3: "WSM", country_code: "685", country_name: "Samoa", mobile_begin_with: ["7"], phone_number_lengths: [7]}, | ||
{alpha2: "YE", alpha3: "YEM", country_code: "967", country_name: "Yemen", mobile_begin_with: ["7"], phone_number_lengths: [9]}, | ||
{alpha2: "ZA", alpha3: "ZAF", country_code: "27", country_name: "South Africa", mobile_begin_with: ["6", "7", "8"], phone_number_lengths: [9]}, | ||
{alpha2: "ZM", alpha3: "ZMB", country_code: "260", country_name: "Zambia", mobile_begin_with: ["9"], phone_number_lengths: [9]}, | ||
{alpha2: "ZW", alpha3: "ZWE", country_code: "263", country_name: "Zimbabwe", mobile_begin_with: ["71", "73", "77"], phone_number_lengths: [9]} | ||
]; | ||
var iso2_map = Object.freeze({ | ||
"AW": "0", "AF": "1", "AO": "2", "AI": "3", "AX": "4", "AL": "5", "AD": "6", "AN": "7", "AE": "8", "AR": "9", "AM": "10", | ||
"AS": "11", "AQ": "12", "TF": "13", "AG": "14", "AU": "15", "AT": "16", "AZ": "17", "BI": "18", "BE": "19", "BJ": "20", | ||
"BF": "21", "BD": "22", "BG": "23", "BH": "24", "BS": "25", "BA": "26", "BL": "27", "BY": "28", "BZ": "29", "BM": "30", | ||
"BO": "31", "BR": "32", "BB": "33", "BN": "34", "BT": "35", "BV": "36", "BW": "37", "CF": "38", "CA": "39", "CC": "40", | ||
"CH": "41", "CL": "42", "CN": "43", "CI": "44", "CM": "45", "CD": "46", "CG": "47", "CK": "48", "CO": "49", "KM": "50", | ||
"CV": "51", "CR": "52", "CU": "53", "CX": "54", "KY": "55", "CY": "56", "CZ": "57", "DE": "58", "DJ": "59", "DM": "60", | ||
"DK": "61", "DO": "62", "DZ": "63", "EC": "64", "EG": "65", "ER": "66", "EH": "67", "ES": "68", "EE": "69", "ET": "70", | ||
"FI": "71", "FJ": "72", "FK": "73", "FR": "74", "FO": "75", "FM": "76", "GA": "77", "GB": "78", "GE": "79", "GG": "80", | ||
"GH": "81", "GI": "82", "GN": "83", "GP": "84", "GM": "85", "GW": "86", "GQ": "87", "GR": "88", "GD": "89", "GL": "90", | ||
"GT": "91", "GF": "92", "GU": "93", "GY": "94", "HK": "95", "HM": "96", "HN": "97", "HR": "98", "HT": "99", "HU": "100", | ||
"ID": "101", "IM": "102", "IN": "103", "IO": "104", "IE": "105", "IR": "106", "IQ": "107", "IS": "108", "IL": "109", "IT": "110", | ||
"JM": "111", "JE": "112", "JO": "113", "JP": "114", "KZ": "115", "KE": "116", "KG": "117", "KH": "118", "KI": "119", "KN": "120", | ||
"KR": "121", "KW": "122", "LA": "123", "LB": "124", "LR": "125", "LY": "126", "LC": "127", "LI": "128", "LK": "129", "LS": "130", | ||
"LT": "131", "LU": "132", "LV": "133", "MO": "134", "MF": "135", "MA": "136", "MC": "137", "MD": "138", "MG": "139", "MV": "140", | ||
"MX": "141", "MH": "142", "MK": "143", "ML": "144", "MT": "145", "MM": "146", "ME": "147", "MN": "148", "MP": "149", "MZ": "150", | ||
"MR": "151", "MS": "152", "MQ": "153", "MU": "154", "MW": "155", "MY": "156", "YT": "157", "NA": "158", "NC": "159", "NE": "160", | ||
"NF": "161", "NG": "162", "NI": "163", "NU": "164", "NL": "165", "NO": "166", "NP": "167", "NR": "168", "NZ": "169", "OM": "170", | ||
"PK": "171", "PA": "172", "PN": "173", "PE": "174", "PH": "175", "PW": "176", "PG": "177", "PL": "178", "PR": "179", "KP": "180", | ||
"PT": "181", "PY": "182", "PS": "183", "PF": "184", "QA": "185", "RE": "186", "RO": "187", "RU": "188", "RW": "189", "SA": "190", | ||
"SD": "191", "SN": "192", "SG": "193", "GS": "194", "SH": "195", "SJ": "196", "SB": "197", "SL": "198", "SV": "199", "SM": "200", | ||
"SO": "201", "PM": "202", "RS": "203", "ST": "204", "SR": "205", "SK": "206", "SI": "207", "SE": "208", "SZ": "209", "SC": "210", | ||
"SY": "211", "TC": "212", "TD": "213", "TG": "214", "TH": "215", "TJ": "216", "TK": "217", "TM": "218", "TL": "219", "TO": "220", | ||
"TT": "221", "TN": "222", "TR": "223", "TV": "224", "TW": "225", "TZ": "226", "UG": "227", "UA": "228", "UM": "229", "UY": "230", | ||
"US": "231", "UZ": "232", "VA": "233", "VC": "234", "VE": "235", "VG": "236", "VI": "237", "VN": "238", "VU": "239", "WF": "240", | ||
"WS": "241", "YE": "242", "ZA": "243", "ZM": "244", "ZW": "245" | ||
}); | ||
var iso3_map = Object.freeze({ | ||
"ABW": "0", "AFG": "1", "AGO": "2", "AIA": "3", "ALA": "4", "ALB": "5", "AND": "6", "ANT": "7", "ARE": "8", "ARG": "9", "ARM": "10", | ||
"ASM": "11", "ATA": "12", "ATF": "13", "ATG": "14", "AUS": "15", "AUT": "16", "AZE": "17", "BDI": "18", "BEL": "19", "BEN": "20", | ||
"BFA": "21", "BGD": "22", "BGR": "23", "BHR": "24", "BHS": "25", "BIH": "26", "BLM": "27", "BLR": "28", "BLZ": "29", "BMU": "30", | ||
"BOL": "31", "BRA": "32", "BRB": "33", "BRN": "34", "BTN": "35", "BVT": "36", "BWA": "37", "CAF": "38", "CAN": "39", "CCK": "40", | ||
"CHE": "41", "CHL": "42", "CHN": "43", "CIV": "44", "CMR": "45", "COD": "46", "COG": "47", "COK": "48", "COL": "49", "COM": "50", | ||
"CPV": "51", "CRI": "52", "CUB": "53", "CXR": "54", "CYM": "55", "CYP": "56", "CZE": "57", "DEU": "58", "DJI": "59", "DMA": "60", | ||
"DNK": "61", "DOM": "62", "DZA": "63", "ECU": "64", "EGY": "65", "ERI": "66", "ESH": "67", "ESP": "68", "EST": "69", "ETH": "70", | ||
"FIN": "71", "FJI": "72", "FLK": "73", "FRA": "74", "FRO": "75", "FSM": "76", "GAB": "77", "GBR": "78", "GEO": "79", "GGY": "80", | ||
"GHA": "81", "GIB": "82", "GIN": "83", "GLP": "84", "GMB": "85", "GNB": "86", "GNQ": "87", "GRC": "88", "GRD": "89", "GRL": "90", | ||
"GTM": "91", "GUF": "92", "GUM": "93", "GUY": "94", "HKG": "95", "HMD": "96", "HND": "97", "HRV": "98", "HTI": "99", "HUN": "100", | ||
"IDN": "101", "IMN": "102", "IND": "103", "IOT": "104", "IRL": "105", "IRN": "106", "IRQ": "107", "ISL": "108", "ISR": "109", "ITA": "110", | ||
"JAM": "111", "JEY": "112", "JOR": "113", "JPN": "114", "KAZ": "115", "KEN": "116", "KGZ": "117", "KHM": "118", "KIR": "119", "KNA": "120", | ||
"KOR": "121", "KWT": "122", "LAO": "123", "LBN": "124", "LBR": "125", "LBY": "126", "LCA": "127", "LIE": "128", "LKA": "129", "LSO": "130", | ||
"LTU": "131", "LUX": "132", "LVA": "133", "MAC": "134", "MAF": "135", "MAR": "136", "MCO": "137", "MDA": "138", "MDG": "139", "MDV": "140", | ||
"MEX": "141", "MHL": "142", "MKD": "143", "MLI": "144", "MLT": "145", "MMR": "146", "MNE": "147", "MNG": "148", "MNP": "149", "MOZ": "150", | ||
"MRT": "151", "MSR": "152", "MTQ": "153", "MUS": "154", "MWI": "155", "MYS": "156", "MYT": "157", "NAM": "158", "NCL": "159", "NER": "160", | ||
"NFK": "161", "NGA": "162", "NIC": "163", "NIU": "164", "NLD": "165", "NOR": "166", "NPL": "167", "NRU": "168", "NZL": "169", "OMN": "170", | ||
"PAK": "171", "PAN": "172", "PCN": "173", "PER": "174", "PHL": "175", "PLW": "176", "PNG": "177", "POL": "178", "PRI": "179", "PRK": "180", | ||
"PRT": "181", "PRY": "182", "PSE": "183", "PYF": "184", "QAT": "185", "REU": "186", "ROU": "187", "RUS": "188", "RWA": "189", "SAU": "190", | ||
"SDN": "191", "SEN": "192", "SGP": "193", "SGS": "194", "SHN": "195", "SJM": "196", "SLB": "197", "SLE": "198", "SLV": "199", "SMR": "200", | ||
"SOM": "201", "SPM": "202", "SRB": "203", "STP": "204", "SUR": "205", "SVK": "206", "SVN": "207", "SWE": "208", "SWZ": "209", "SYC": "210", | ||
"SYR": "211", "TCA": "212", "TCD": "213", "TGO": "214", "THA": "215", "TJK": "216", "TKL": "217", "TKM": "218", "TLS": "219", "TON": "220", | ||
"TTO": "221", "TUN": "222", "TUR": "223", "TUV": "224", "TWN": "225", "TZA": "226", "UGA": "227", "UKR": "228", "UMI": "229", "URY": "230", | ||
"USA": "231", "UZB": "232", "VAT": "233", "VCT": "234", "VEN": "235", "VGB": "236", "VIR": "237", "VNM": "238", "VUT": "239", "WLF": "240", | ||
"WSM": "241", "YEM": "242", "ZAF": "243", "ZMB": "244", "ZWE": "245" | ||
}); | ||
var country_name_map = Object.freeze({ | ||
"0": "Aruba", | ||
"1": "Afghanistan", | ||
"2": "Angola", | ||
"3": "Anguilla", | ||
"4": "Åland Islands", | ||
"5": "Albania", | ||
"6": "Andorra", | ||
"7": "Netherlands Antilles", | ||
"8": "United Arab Emirates", | ||
"9": "Argentina", | ||
"10": "Armenia", | ||
"11": "American Samoa", | ||
"12": "Antarctica", | ||
"13": "French Southern Territories", | ||
"14": "Antigua and Barbuda", | ||
"15": "Australia", | ||
"16": "Austria", | ||
"17": "Azerbaijan", | ||
"18": "Burundi", | ||
"19": "Belgium", | ||
"20": "Benin", | ||
"21": "Burkina Faso", | ||
"22": "Bangladesh", | ||
"23": "Bulgaria", | ||
"24": "Bahrain", | ||
"25": "Bahamas", | ||
"26": "Bosnia and Herzegovina", | ||
"27": "Saint Barthélemy", | ||
"28": "Belarus", | ||
"29": "Belize", | ||
"30": "Bermuda", | ||
"31": "Bolivia", | ||
"32": "Brazil", | ||
"33": "Barbados", | ||
"34": "Brunei Darussalam", | ||
"35": "Bhutan", | ||
"36": "Bouvet Island", | ||
"37": "Botswana", | ||
"38": "Central African Republic", | ||
"39": "Canada", | ||
"40": "Cocos (Keeling) Islands", | ||
"41": "Switzerland", | ||
"42": "Chile", | ||
"43": "China", | ||
"44": "Côte D'Ivoire", | ||
"45": "Cameroon", | ||
"46": "Congo, The Democratic Republic Of The", | ||
"47": "Congo", | ||
"48": "Cook Islands", | ||
"49": "Colombia", | ||
"50": "Comoros", | ||
"51": "Cape Verde", | ||
"52": "Costa Rica", | ||
"53": "Cuba", | ||
"54": "Christmas Island", | ||
"55": "Cayman Islands", | ||
"56": "Cyprus", | ||
"57": "Czech Republic", | ||
"58": "Germany", | ||
"59": "Djibouti", | ||
"60": "Dominica", | ||
"61": "Denmark", | ||
"62": "Dominican Republic", | ||
"63": "Algeria", | ||
"64": "Ecuador", | ||
"65": "Egypt", | ||
"66": "Eritrea", | ||
"67": "Western Sahara", | ||
"68": "Spain", | ||
"69": "Estonia", | ||
"70": "Ethiopia", | ||
"71": "Finland", | ||
"72": "Fiji", | ||
"73": "Falkland Islands (Malvinas)", | ||
"74": "France", | ||
"75": "Faroe Islands", | ||
"76": "Micronesia, Federated States Of", | ||
"77": "Gabon", | ||
"78": "United Kingdom", | ||
"79": "Georgia", | ||
"80": "Guernsey", | ||
"81": "Ghana", | ||
"82": "Gibraltar", | ||
"83": "Guinea", | ||
"84": "Guadeloupe", | ||
"85": "Gambia", | ||
"86": "Guinea-Bissau", | ||
"87": "Equatorial Guinea", | ||
"88": "Greece", | ||
"89": "Grenada", | ||
"90": "Greenland", | ||
"91": "Guatemala", | ||
"92": "French Guiana", | ||
"93": "Guam", | ||
"94": "Guyana", | ||
"95": "Hong Kong", | ||
"96": "Heard and McDonald Islands", | ||
"97": "Honduras", | ||
"98": "Croatia", | ||
"99": "Haiti", | ||
"100": "Hungary", | ||
"101": "Indonesia", | ||
"102": "Isle of Man", | ||
"103": "India", | ||
"104": "British Indian Ocean Territory", | ||
"105": "Ireland", | ||
"106": "Iran, Islamic Republic Of", | ||
"107": "Iraq", | ||
"108": "Iceland", | ||
"109": "Israel", | ||
"110": "Italy", | ||
"111": "Jamaica", | ||
"112": "Jersey", | ||
"113": "Jordan", | ||
"114": "Japan", | ||
"115": "Kazakhstan", | ||
"116": "Kenya", | ||
"117": "Kyrgyzstan", | ||
"118": "Cambodia", | ||
"119": "Kiribati", | ||
"120": "Saint Kitts And Nevis", | ||
"121": "Korea, Republic of", | ||
"122": "Kuwait", | ||
"123": "Lao People's Democratic Republic", | ||
"124": "Lebanon", | ||
"125": "Liberia", | ||
"126": "Libyan Arab Jamahiriya", | ||
"127": "Saint Lucia", | ||
"128": "Liechtenstein", | ||
"129": "Sri Lanka", | ||
"130": "Lesotho", | ||
"131": "Lithuania", | ||
"132": "Luxembourg", | ||
"133": "Latvia", | ||
"134": "Macao", | ||
"135": "Saint Martin", | ||
"136": "Morocco", | ||
"137": "Monaco", | ||
"138": "Moldova, Republic of", | ||
"139": "Madagascar", | ||
"140": "Maldives", | ||
"141": "Mexico", | ||
"142": "Marshall Islands", | ||
"143": "Macedonia, the Former Yugoslav Republic Of", | ||
"144": "Mali", | ||
"145": "Malta", | ||
"146": "Myanmar", | ||
"147": "Montenegro", | ||
"148": "Mongolia", | ||
"149": "Northern Mariana Islands", | ||
"150": "Mozambique", | ||
"151": "Mauritania", | ||
"152": "Montserrat", | ||
"153": "Martinique", | ||
"154": "Mauritius", | ||
"155": "Malawi", | ||
"156": "Malaysia", | ||
"157": "Mayotte", | ||
"158": "Namibia", | ||
"159": "New Caledonia", | ||
"160": "Niger", | ||
"161": "Norfolk Island", | ||
"162": "Nigeria", | ||
"163": "Nicaragua", | ||
"164": "Niue", | ||
"165": "Netherlands", | ||
"166": "Norway", | ||
"167": "Nepal", | ||
"168": "Nauru", | ||
"169": "New Zealand", | ||
"170": "Oman", | ||
"171": "Pakistan", | ||
"172": "Panama", | ||
"173": "Pitcairn", | ||
"174": "Peru", | ||
"175": "Philippines", | ||
"176": "Palau", | ||
"177": "Papua New Guinea", | ||
"178": "Poland", | ||
"179": "Puerto Rico", | ||
"180": "Korea, Democratic People's Republic Of", | ||
"181": "Portugal", | ||
"182": "Paraguay", | ||
"183": "Palestinian Territory, Occupied", | ||
"184": "French Polynesia", | ||
"185": "Qatar", | ||
"186": "Réunion", | ||
"187": "Romania", | ||
"188": "Russian Federation", | ||
"189": "Rwanda", | ||
"190": "Saudi Arabia", | ||
"191": "Sudan", | ||
"192": "Senegal", | ||
"193": "Singapore", | ||
"194": "South Georgia and the South Sandwich Islands", | ||
"195": "Saint Helena", | ||
"196": "Svalbard And Jan Mayen", | ||
"197": "Solomon Islands", | ||
"198": "Sierra Leone", | ||
"199": "El Salvador", | ||
"200": "San Marino", | ||
"201": "Somalia", | ||
"202": "Saint Pierre And Miquelon", | ||
"203": "Serbia", | ||
"204": "Sao Tome and Principe", | ||
"205": "Suriname", | ||
"206": "Slovakia", | ||
"207": "Slovenia", | ||
"208": "Sweden", | ||
"209": "Swaziland", | ||
"210": "Seychelles", | ||
"211": "Syrian Arab Republic", | ||
"212": "Turks and Caicos Islands", | ||
"213": "Chad", | ||
"214": "Togo", | ||
"215": "Thailand", | ||
"216": "Tajikistan", | ||
"217": "Tokelau", | ||
"218": "Turkmenistan", | ||
"219": "Timor-Leste", | ||
"220": "Tonga", | ||
"221": "Trinidad and Tobago", | ||
"222": "Tunisia", | ||
"223": "Turkey", | ||
"224": "Tuvalu", | ||
"225": "Taiwan, Province Of China", | ||
"226": "Tanzania, United Republic of", | ||
"227": "Uganda", | ||
"228": "Ukraine", | ||
"229": "United States Minor Outlying Islands", | ||
"230": "Uruguay", | ||
"231": "United States", | ||
"232": "Uzbekistan", | ||
"233": "Holy See (Vatican City State)", | ||
"234": "Saint Vincent And The Grenedines", | ||
"235": "Venezuela, Bolivarian Republic of", | ||
"236": "Virgin Islands, British", | ||
"237": "Virgin Islands, U.S.", | ||
"238": "Viet Nam", | ||
"239": "Vanuatu", | ||
"240": "Wallis and Futuna", | ||
"241": "Samoa", | ||
"242": "Yemen", | ||
"243": "South Africa", | ||
"244": "Zambia", | ||
"245": "Zimbabwe" | ||
}); | ||
var country_lookup = {}; | ||
function getISO3166(country) { | ||
var iso3166 = country_lookup[country]; | ||
if ( iso3166 ) { | ||
return iso3166; | ||
} | ||
// assign default to USA country first | ||
var iso3166 = {}, | ||
i; | ||
if (country) { | ||
if (country.length === 3) { | ||
//iso3 | ||
if (!iso3_map[country]) { | ||
//default | ||
iso3166 = iso3166_data[iso3_map.USA]; | ||
} else { | ||
iso3166 = iso3166_data[iso3_map[country]]; | ||
switch (country.length) { | ||
case 0: | ||
iso3166 = iso3166_data[0]; | ||
break; | ||
case 2: | ||
for (i in iso3166_data) { | ||
if (country.toUpperCase() === iso3166_data[i].alpha2) { | ||
iso3166 = iso3166_data[i]; | ||
break; | ||
} | ||
} | ||
} else if (country.length === 2) { | ||
//iso2 | ||
if (!iso2_map[country]) { | ||
//default | ||
iso3166 = iso3166_data[iso3_map.USA]; | ||
} else { | ||
iso3166 = iso3166_data[iso2_map[country]]; | ||
break; | ||
case 3: | ||
for (i in iso3166_data) { | ||
if (country.toUpperCase() === iso3166_data[i].alpha3) { | ||
iso3166 = iso3166_data[i]; | ||
break; | ||
} | ||
} | ||
} else { | ||
for (var i in country_name_map) { | ||
var regex = new RegExp('^' + country + '$', 'i'); | ||
var match = country_name_map[i].search(regex); | ||
if (match !== -1) { | ||
break; | ||
default: | ||
for (i in iso3166_data) { | ||
if (country.toLowerCase() === iso3166_data[i].country_name.toLowerCase()) { | ||
iso3166 = iso3166_data[i]; | ||
@@ -621,89 +322,125 @@ break; | ||
} | ||
} | ||
if (!iso3166) { | ||
//default | ||
iso3166 = iso3166_data[iso3_map.USA]; | ||
return iso3166; | ||
} | ||
function get_iso3166_by_phone(phone) { | ||
var regex; | ||
for (var i in iso3166_data) { | ||
regex = new RegExp('^' + iso3166_data[i].country_code); | ||
for (var j in iso3166_data[i].phone_number_lengths) { | ||
if (phone.match(regex) && phone.length === iso3166_data[i].country_code.length + iso3166_data[i].phone_number_lengths[j]) { | ||
// it match.. but may have more than one result. | ||
// e.g. USA and Canada. need to check mobile_begin_with | ||
for (var k in iso3166_data[i].mobile_begin_with) { | ||
if (phone.match(new RegExp('^' + iso3166_data[i].country_code + iso3166_data[i].mobile_begin_with[k]))) { | ||
return iso3166_data[i] | ||
} | ||
} | ||
} | ||
} | ||
} else { | ||
iso3166 = iso3166_data[iso3_map.USA]; | ||
} | ||
country_lookup[country] = iso3166; | ||
return iso3166; | ||
return {}; | ||
} | ||
function validate_phone_iso3166(phone, iso3166) { | ||
phone = phone.replace(new RegExp('^' + iso3166.country_code), ''); | ||
for (var i in iso3166.phone_number_lengths) { | ||
if (phone.length === iso3166.phone_number_lengths[i]) { | ||
for (var j in iso3166.mobile_begin_with) { | ||
if (phone.match(new RegExp('^' + iso3166.mobile_begin_with[j]))) { | ||
return true; | ||
} | ||
} | ||
} | ||
} | ||
return false; | ||
} | ||
/** | ||
* | ||
* if there is + sign in the phone, it will skip ALL validation and simply return the clean E.164 phone format | ||
* | ||
* 1. If no "+" sign, must treat as USA phone | ||
* @param phone | ||
* @param country | ||
* @returns {*} | ||
* @returns [] | ||
*/ | ||
module.exports = function(phone, country) { | ||
var result = []; | ||
phone = (phone === null || typeof(phone) !== 'string') ? '' : phone.trim(); | ||
country = (country === null || typeof(country) !== 'string') ? '' : country.trim(); | ||
var plus_sign = false; | ||
if (phone.match(/^\+/)) { | ||
return '+' + phone.replace(/\D/g, ''); | ||
plus_sign = true; | ||
} | ||
// remove any non-digit character | ||
// remove any non-digit character, included the + | ||
phone = phone.replace(/\D/g, ''); | ||
var iso3166 = getISO3166(country); | ||
var iso3166 = getISO3166(country); // if no country, default is USA | ||
// remove leading 0s for all countries except 'GAB', 'CIV', 'COG' | ||
if (['GAB', 'CIV', 'COG'].indexOf(iso3166.alpha3) === -1) { | ||
phone = phone.replace(/^0+/, ''); | ||
if (Object.keys(iso3166).length === 0) { | ||
return result; | ||
} | ||
if (country) { | ||
// remove leading 0s for all countries except 'GAB', 'CIV', 'COG' | ||
if (['GAB', 'CIV', 'COG'].indexOf(iso3166.alpha3) === -1) { | ||
phone = phone.replace(/^0+/, ''); | ||
} | ||
var output_set = []; | ||
var validated_by_begin_with = function(phone, iso3166) { | ||
if (!iso3166.mobile_begin_with.length && output_set.indexOf(phone) === -1) { | ||
output_set.push(phone); | ||
// if input 89234567890, RUS, remove the 8 | ||
if (iso3166.alpha3 === 'RUS' && phone.length === 11 && phone.match(/^89/) !== null) { | ||
phone = phone.replace(/^8+/, ''); | ||
} | ||
for (var i in iso3166.mobile_begin_with) { | ||
var regex = new RegExp('^' + iso3166.mobile_begin_with[i]); | ||
if (phone.match(regex) && output_set.indexOf(phone) === -1) { | ||
output_set.push(phone); | ||
if (plus_sign) { | ||
// D is here. | ||
} else { | ||
// C: have country, no plus sign ---> | ||
// case 1 | ||
// check phone_number_length == phone.length | ||
// add back the country code | ||
// case 2 | ||
// phone_number_length+phone_country_code.length == phone.length | ||
// then go to D | ||
if (iso3166.phone_number_lengths.indexOf(phone.length) !== -1) { | ||
phone = iso3166.country_code + phone; | ||
} | ||
} | ||
}; | ||
//if no length validation | ||
if (iso3166.phone_number_lengths.length === 0) { | ||
//remove leading country code | ||
phone = phone.replace(new RegExp('^' + iso3166.country_code), ''); | ||
validated_by_begin_with(phone, iso3166); | ||
} else { | ||
//length validation | ||
for (var i in iso3166.phone_number_lengths) { | ||
var phone_temp = phone; | ||
if (plus_sign) { | ||
// A: no country, have plus sign --> lookup country_code, length, and get the iso3166 directly | ||
// also validation is done here. so, the iso3166 is the matched result. | ||
iso3166 = get_iso3166_by_phone(phone); | ||
//length of country code + phone | ||
var total_number_len = iso3166.phone_number_lengths[i] + iso3166.country_code.length; | ||
if (phone_temp.length === total_number_len) { | ||
//remove leading country code | ||
phone_temp = phone_temp.replace(new RegExp('^' + iso3166.country_code), ''); | ||
} else { | ||
// B: no country, no plus sign --> treat it as USA | ||
// 1. check length if == 11, or 10, if 10, add +1, then go go D | ||
// no plus sign, no country is given. then it must be USA | ||
//iso3166 = iso3166_data[0]; already assign by the default value | ||
if (iso3166.phone_number_lengths.indexOf(phone.length) !== -1) { | ||
phone = '1' + phone; | ||
} | ||
} | ||
if (phone_temp.length === iso3166.phone_number_lengths[i]) { | ||
validated_by_begin_with(phone_temp, iso3166); | ||
} | ||
} | ||
} | ||
if (output_set.length) { | ||
return '+' + iso3166.country_code + output_set[0]; | ||
} else { | ||
return null; | ||
if (validate_phone_iso3166(phone, iso3166)) { | ||
return ['+' + phone, iso3166.alpha3]; | ||
} | ||
return result; | ||
}; |
{ | ||
"name": "phone", | ||
"version": "0.0.6", | ||
"description": "With a given country and phone number, validate and format the phone number to E.164 standard", | ||
"main": "./lib/index", | ||
"engines": { | ||
"node": ">=0.8" | ||
}, | ||
"directories": { | ||
"test": "test" | ||
}, | ||
"scripts": { | ||
"test": "mocha --recursive -R spec" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/aftership/node-phone" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/aftership/node-phone/issues" | ||
}, | ||
"devDependencies": { | ||
"mocha": "latest", | ||
"should": "latest" | ||
}, | ||
"keywords": [ | ||
"phone", | ||
"e.164" | ||
], | ||
"author": "AfterShip", | ||
"license": "MIT", | ||
"homepage": "https://github.com/aftership/node-phone", | ||
"dependencies": { | ||
"should": "~3.0.1" | ||
} | ||
"name": "phone", | ||
"version": "1.0.2", | ||
"description": "With a given country and phone number, validate and format the phone number to E.164 standard", | ||
"main": "./lib/index", | ||
"engines": { | ||
"node": ">=0.8" | ||
}, | ||
"directories": { | ||
"lib": "./lib" | ||
}, | ||
"scripts": { | ||
"test": "mocha --recursive -R spec" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/aftership/node-phone" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/aftership/node-phone/issues" | ||
}, | ||
"devDependencies": { | ||
"mocha": "latest", | ||
"should": "latest" | ||
}, | ||
"keywords": [ | ||
"phone", "e.164" | ||
], | ||
"author": "AfterShip", | ||
"license": "MIT" | ||
} |
@@ -19,4 +19,5 @@ ## What is node-phone? | ||
##FAQ | ||
##FAQ (1.x branch) | ||
1. Does node-phone do any phone validation? | ||
@@ -26,2 +27,25 @@ | ||
`phone` will validate `phone_number_lengths` and `mobile_begin_with` | ||
2. Why some of the number is valid, but return null? | ||
This npm is used to validate a mobile phone number for sending the SMS. | ||
So, we try to match all possible rule, such as area code, number prefix, etc. to test if it is a mobile phone number. | ||
However, some countries, like USA, we can only check if it is a valid `AREA CODE`, there is no mobile phone prefix. | ||
For UK, we know that mobile phone number is always start with `7`, in this case, this npm will be more helpful. | ||
3. Why do you make this? | ||
Because we need to normalize the phone number for SMS notification for mobile phone only. | ||
We don't validate if the number is mobile or not. | ||
##FAQ (0.0.x branch) | ||
1. Does node-phone do any phone validation? | ||
Yes: If you provide the 2nd parameter (country), and the phone number do not start with `+` sign. | ||
`phone` will validate `phone_number_lengths` and `validation_begin_with` | ||
@@ -52,10 +76,29 @@ | ||
## Usage | ||
## Usage (1.x branch) | ||
``` | ||
var phone = require('phone'); | ||
phone('(817) 569-8900'); // return ['+18175698900, 'USA'] | ||
phone('(817) 569-8900', ''); // return ['+18175698900, 'USA'] | ||
phone('(817) 569-8900', 'USA'); // return ['+18175698900', 'USA'] | ||
phone('(817) 569-8900', 'HKG'); // return [] | ||
phone('+1(817) 569-8900', 'HKG'); // return [], as it is not a valid HKG mobile phone number | ||
phone('+1(817) 569-8900', ''); // return ['+18175698900', 'USA'] | ||
phone('(817) 569-8900', ''); // return ['+18175698900', 'USA'] | ||
phone('6123-6123', ''); // return [], as default country is USA | ||
phone('6123-6123', 'HKG'); // return ['+85261236123', 'HKG'] | ||
``` | ||
## Usage (0.0.x branch) | ||
``` | ||
var phone = require('phone'); | ||
phone('(817) 569-8900', ''); // return +18175698900 | ||
phone('(817) 569-8900', 'USA'); // return +18175698900 | ||
phone('(817) 569-8900', 'HKG'); // return null | ||
phone('+1(817) 569-8900', HKG); // return +18175698900 | ||
phone('+1(817) 569-8900', 'HKG'); // return +18175698900 | ||
phone('+1(817) 569-8900', ''); // return +18175698900 | ||
phone('(817) 569-8900', ''); // return +18175698900 | ||
@@ -82,2 +125,9 @@ phone('6123-6123', ''); // return null, as default country is USA | ||
## Change Log | ||
* 1.0.0 `NOT compatible` with the `0.0.x branch` | ||
Major changes: | ||
1. phone will return array with `formatted phone` and `iso3166 alpha3`. | ||
2. If not valid, will return `empty array` instead of `null`. | ||
3. If `country` is passed, phone will do validation on the phone number against the country. | ||
If they are not match, phone will `return empty array` instead of the `formatted E.164 phone`. | ||
* 0.0.6 Added France mobile prefix `7`, updated USA, Canada area code. | ||
@@ -84,0 +134,0 @@ * 0.0.5 Performance tuning, updated Iceland mobile format to 7 digits only. |
var should = require('should'), | ||
phone = require('../lib/index'); | ||
describe('Testing USA Phone', function() { | ||
/* suggest 10 test case for each country, except USA | ||
Test Case, for non-USA | ||
describe("phone('(817) 569-8900', '')", function() { | ||
it('returns +18175698900, as no country code given, will treat it as USA', function() { | ||
var result = phone('(817) 569-8900', ''); | ||
result.should.eql('+18175698900'); | ||
valid +phone, null | ||
valid +phone, valid iso | ||
valid +phone, invalid iso | ||
valid +phone, valid name | ||
valid +phone, invalid name | ||
invalid +phone, null | ||
invalid +phone, valid iso | ||
invalid +phone, invalid iso | ||
invalid +phone, valid name | ||
invalid +phone, invalid name | ||
valid phone, null | ||
valid phone, valid iso | ||
valid phone, invalid iso | ||
valid phone, valid name | ||
valid phone, invalid name | ||
invalid phone, null | ||
invalid phone, valid iso | ||
invalid phone, invalid iso | ||
invalid phone, valid name | ||
invalid phone, invalid name | ||
*/ | ||
describe('Testing input parameter Phone', function() { | ||
describe('Test 1', function() { | ||
var number = '(852) 569-8900', | ||
result = []; | ||
it('returns ' + result, function() { | ||
phone(number).should.eql(result); | ||
}); | ||
}); | ||
describe('Test 2', function() { | ||
var number = '+1 (817) 569-8900', | ||
result = ['+18175698900', 'USA']; | ||
it('returns ' + result, function() { | ||
phone(number).should.eql(result); | ||
}); | ||
}); | ||
describe("phone('(852) 569-8900', '')", function() { | ||
it('returns null, will treat it as USA, but 852 is NOT a valid USA mobile_begin_with', function() { | ||
var result = (phone('(852) 569-8900', '') === null); | ||
result.should.eql(true); | ||
}); | ||
describe('Testing USA Phone', function() { | ||
describe('Test 1', function() { | ||
var number = '(852) 569-8900', | ||
country = '', | ||
result = []; | ||
it('returns ' + result, function() { | ||
phone(number, country).should.eql(result); | ||
}); | ||
}); | ||
describe("phone('+1 (817) 569-8900', '')", function() { | ||
it('returns +18175698900', function() { | ||
var result = phone('+1 (817) 569-8900', ''); | ||
result.should.eql('+18175698900'); | ||
describe('Test 2', function() { | ||
var number = '+1 (817) 569-8900', | ||
country = '', | ||
result = ['+18175698900', 'USA']; | ||
it('returns ' + result, function() { | ||
phone(number, country).should.eql(result); | ||
}); | ||
}); | ||
describe("phone('+1 (817) 569-8900', null)", function() { | ||
it('returns +18175698900', function() { | ||
var result = phone('+1 (817) 569-8900', null); | ||
result.should.eql('+18175698900'); | ||
describe('Test 3', function() { | ||
var number = '+1 (817) 569-8900', | ||
country = null, | ||
result = ['+18175698900', 'USA']; | ||
it('returns ' + result, function() { | ||
phone(number, country).should.eql(result); | ||
}); | ||
}); | ||
describe("phone('212345678', '')", function() { | ||
it('returns null', function() { | ||
var result = (phone('212345678', '') === null); | ||
result.should.eql(true); | ||
describe('Test 4', function() { | ||
var number = '2121234567', | ||
country = '', | ||
result = ['+12121234567', 'USA']; | ||
it('returns ' + result, function() { | ||
phone(number, country).should.eql(result); | ||
}); | ||
}); | ||
describe('Test 5', function() { | ||
var number = '22-6569-8900', | ||
country = '', | ||
result = []; | ||
it('returns ' + result, function() { | ||
phone(number, country).should.eql(result); | ||
}); | ||
}); | ||
describe("phone('22-6569-8900', '')", function() { | ||
it('returns null, as 226 is NOT a valid USA code', function() { | ||
var result = (phone('22-6569-8900', '') == null); | ||
result.should.eql(true); | ||
describe('Test 6', function() { | ||
var number = '22-5569-8900', | ||
country = '', | ||
result = ['+12255698900', 'USA']; | ||
it('returns ' + result, function() { | ||
phone(number, country).should.eql(result); | ||
}); | ||
}); | ||
describe("phone('22-5569-8900', '')", function() { | ||
it('returns +12255698900', function() { | ||
var result = phone('22-5569-8900', ''); | ||
result.should.eql('+12255698900'); | ||
describe('Test 7', function() { | ||
var number = '+1 (817) 569-8900', | ||
country = 'United States', | ||
result = ['+18175698900', 'USA']; | ||
it('returns ' + result, function() { | ||
phone(number, country).should.eql(result); | ||
}); | ||
}); | ||
describe("phone('+1 (817) 569-8900', 'United States')", function() { | ||
it('returns +18175698900', function() { | ||
var result = phone('+1 (817) 569-8900', 'United States'); | ||
result.should.eql('+18175698900'); | ||
describe('Test 8', function() { | ||
var number = '+1 (817) 569-8900', | ||
country = 'United States ', | ||
result = ['+18175698900', 'USA']; | ||
it('returns ' + result, function() { | ||
phone(number, country).should.eql(result); | ||
}); | ||
}); | ||
describe("phone('+1 (817) 569-8900', ' United States ')", function() { | ||
it('returns +18175698900', function() { | ||
var result = phone('+1 (817) 569-8900', ' United States '); | ||
result.should.eql('+18175698900'); | ||
describe('Test 9', function() { | ||
var number = '+1 (817) 569-8900', | ||
country = 'USA', | ||
result = ['+18175698900', 'USA']; | ||
it('returns ' + result, function() { | ||
phone(number, country).should.eql(result); | ||
}); | ||
}); | ||
describe("phone('+1 (817) 569-8900', 'USA')", function() { | ||
it('returns +18175698900', function() { | ||
var result = phone('+1 (817) 569-8900', 'USA'); | ||
result.should.eql('+18175698900'); | ||
describe('Test 10', function() { | ||
var number = '+1 (817) 569-8900', | ||
country = 'USA ', | ||
result = ['+18175698900', 'USA']; | ||
it('returns ' + result, function() { | ||
phone(number, country).should.eql(result); | ||
}); | ||
}); | ||
describe("phone('+1 (817) 569-8900', 'US')", function() { | ||
it('returns +18175698900', function() { | ||
var result = phone('+1 (817) 569-8900', 'US'); | ||
result.should.eql('+18175698900'); | ||
describe('Test 11', function() { | ||
var number = '+1 (817) 569-8900', | ||
country = 'US', | ||
result = ['+18175698900', 'USA']; | ||
it('returns ' + result, function() { | ||
phone(number, country).should.eql(result); | ||
}); | ||
}); | ||
describe('Test 12', function() { | ||
var number = '+1 (817) 569-8900', | ||
country = ' US', | ||
result = ['+18175698900', 'USA']; | ||
it('returns ' + result, function() { | ||
phone(number, country).should.eql(result); | ||
}); | ||
}); | ||
describe('Test 13', function() { | ||
var number = '+1 (817) 569-8900', | ||
country = 'HKG', | ||
result = []; | ||
it('returns ' + result, function() { | ||
phone(number, country).should.eql(result); | ||
}); | ||
}); | ||
}); | ||
describe('Testing CAN Phone', function() { | ||
describe('Testing MEX Phone', function() { | ||
// valid +phone, null | ||
// valid +phone, valid iso | ||
// valid +phone, invalid iso | ||
// valid +phone, valid name | ||
// valid +phone, invalid name | ||
describe("phone('+1 (403) 569-8900', '')", function() { | ||
it('returns +14035698900', function() { | ||
var result = phone('+1 (403) 569-8900', ''); | ||
result.should.eql('+14035698900'); | ||
describe('Test 1', function() { | ||
var number = '+52 1 762 100 9517', | ||
country = null, | ||
result = ['+5217621009517', 'MEX']; | ||
it('returns ' + result, function() { | ||
phone(number, country).should.eql(result); | ||
}); | ||
}); | ||
describe("phone('+1 (403) 569-8900', null)", function() { | ||
it('returns +14035698900', function() { | ||
var result = phone('+1 (403) 569-8900', null); | ||
result.should.eql('+14035698900'); | ||
describe('Test 2', function() { | ||
var number = '+52 1 762 100 9517', | ||
country = 'MEX', | ||
result = ['+5217621009517', 'MEX']; | ||
it('returns ' + result, function() { | ||
phone(number, country).should.eql(result); | ||
}); | ||
}); | ||
describe("phone('212345678', '')", function() { | ||
it('returns null', function() { | ||
var result = (phone('212345678', '') === null); | ||
result.should.eql(true); | ||
describe('Test 3', function() { | ||
var number = '+52 1 762 100 9517', | ||
country = 'USA', | ||
result = []; | ||
it('returns ' + result, function() { | ||
phone(number, country).should.eql(result); | ||
}); | ||
}); | ||
describe('Test 4', function() { | ||
var number = '+52 1 762 100 9517', | ||
country = 'Mexico', | ||
result = ['+5217621009517', 'MEX']; | ||
it('returns ' + result, function() { | ||
phone(number, country).should.eql(result); | ||
}); | ||
}); | ||
describe('Test 5', function() { | ||
var number = '+52 1 762 100 9517', | ||
country = 'United States', | ||
result = []; | ||
it('returns ' + result, function() { | ||
phone(number, country).should.eql(result); | ||
}); | ||
}); | ||
// invalid +phone, null | ||
// invalid +phone, valid iso | ||
// invalid +phone, invalid iso | ||
// invalid +phone, valid name | ||
// invalid +phone, invalid name | ||
describe("phone('40-3569-8900', '')", function() { | ||
// as 403 is NOT a valid USA code | ||
it('returns null', function() { | ||
var result = (phone('40-3569-8900', '') == null); | ||
result.should.eql(true); | ||
describe('Test 6', function() { | ||
var number = '+52 62 100 9517', | ||
country = null, | ||
result = []; | ||
it('returns ' + result, function() { | ||
phone(number, country).should.eql(result); | ||
}); | ||
}); | ||
describe('Test 7', function() { | ||
var number = '+52 62 100 9517', | ||
country = 'MEX', | ||
result = []; | ||
it('returns ' + result, function() { | ||
phone(number, country).should.eql(result); | ||
}); | ||
}); | ||
describe('Test 8', function() { | ||
var number = '+52 62 100 9517', | ||
country = 'USA', | ||
result = []; | ||
it('returns ' + result, function() { | ||
phone(number, country).should.eql(result); | ||
}); | ||
}); | ||
describe('Test 9', function() { | ||
var number = '+52 62 100 9517', | ||
country = 'Mexico', | ||
result = []; | ||
it('returns ' + result, function() { | ||
phone(number, country).should.eql(result); | ||
}); | ||
}); | ||
describe('Test 10', function() { | ||
var number = '+52 62 100 9517', | ||
country = 'United States', | ||
result = []; | ||
it('returns ' + result, function() { | ||
phone(number, country).should.eql(result); | ||
}); | ||
}); | ||
describe("phone('40-3569-8900', 'CAN')", function() { | ||
// should return +14035698900, as it is a valid CAN phone | ||
it('returns +14035698900', function() { | ||
var result = phone('40-3569-8900', 'CAN'); | ||
result.should.eql('+14035698900'); | ||
// valid phone, null | ||
// valid phone, valid iso | ||
// valid phone, invalid iso | ||
// valid phone, valid name | ||
// valid phone, invalid name | ||
describe('Test 11', function() { | ||
var number = '52762 100 9517', | ||
country = null, | ||
result = []; | ||
it('returns ' + result, function() { | ||
phone(number, country).should.eql(result); | ||
}); | ||
}); | ||
describe('Test 12', function() { | ||
var number = '762 100 9517', | ||
country = 'MEX', | ||
result = ['+527621009517', 'MEX']; | ||
it('returns ' + result, function() { | ||
phone(number, country).should.eql(result); | ||
}); | ||
}); | ||
describe('Test 13', function() { | ||
var number = '762 100 9517', | ||
country = 'MEXINVALID', | ||
result = []; | ||
it('returns ' + result, function() { | ||
phone(number, country).should.eql(result); | ||
}); | ||
}); | ||
describe('Test 14', function() { | ||
var number = '762 100 9517', | ||
country = 'Mexico', | ||
result = ['+527621009517', 'MEX']; | ||
it('returns ' + result, function() { | ||
phone(number, country).should.eql(result); | ||
}); | ||
}); | ||
describe('Test 15', function() { | ||
var number = '762 100 9517', | ||
country = 'Mexico Invalid', | ||
result = []; | ||
it('returns ' + result, function() { | ||
phone(number, country).should.eql(result); | ||
}); | ||
}); | ||
@@ -132,82 +330,146 @@ | ||
describe('Testing HK Phone', function() { | ||
describe("phone('6569-8900', '')", function() { | ||
it('returns null', function() { | ||
var result = (phone('6569-8900', '') === null); | ||
result.should.eql(true); | ||
describe('Testing HKG Phone Quick Test', function() { | ||
describe('Test 1', function() { | ||
var number = '6123-6123', | ||
country = 'HKG', | ||
result = ['+85261236123', 'HKG']; | ||
it('returns ' + result, function() { | ||
phone(number, country).should.eql(result); | ||
}); | ||
}); | ||
describe("phone('6569-8900', null)", function() { | ||
it('returns null', function() { | ||
var result = (phone('6569-8900', null) === null); | ||
result.should.eql(true); | ||
}); | ||
describe('Testing BRA Phone Quick Test', function() { | ||
describe('Test 1', function() { | ||
var number = '+55 11 9 6123 1234', | ||
country = 'BRA', | ||
result = ['+5511961231234', 'BRA']; | ||
it('returns ' + result, function() { | ||
phone(number, country).should.eql(result); | ||
}); | ||
}); | ||
describe("phone('+852 8-569-8900', 'HKG')", function() { | ||
it('returns +85285698900', function() { | ||
var result = phone('+852 8-569-8900', 'HKG'); | ||
result.should.eql('+85285698900'); | ||
describe('Test 2', function() { | ||
var number = '+55 11 6123 1234', // as 9 is missing | ||
country = 'BRA', | ||
result = []; | ||
it('returns ' + result, function() { | ||
phone(number, country).should.eql(result); | ||
}); | ||
}); | ||
describe("phone('+852 8-569-8900', 'USA')", function() { | ||
it('returns +85285698900', function() { | ||
var result = phone('+852 8-569-8900', 'USA'); | ||
result.should.eql('+85285698900'); | ||
describe('Test 4', function() { | ||
var number = '+55 11 8 6123 1234', // prefix must be 9 after area code | ||
country = 'BRA', | ||
result = []; | ||
it('returns ' + result, function() { | ||
phone(number, country).should.eql(result); | ||
}); | ||
}); | ||
describe("phone('+852 8-569-8900', 'HK')", function() { | ||
it('returns +85285698900', function() { | ||
var result = phone('+852 8-569-8900', 'HK'); | ||
result.should.eql('+85285698900'); | ||
describe('Test 2', function() { | ||
var number = '+55 69 8 6123 1234', // we don't check prefix for area code 69 | ||
country = 'BRA', | ||
result = ['+5569861231234', 'BRA']; | ||
it('returns ' + result, function() { | ||
phone(number, country).should.eql(result); | ||
}); | ||
}); | ||
describe("phone('212345678', 'HKG')", function() { | ||
it('returns null', function() { | ||
var result = (phone('212345678', 'HKG') === null); | ||
result.should.eql(true); | ||
}); | ||
// input --> output | ||
// 89234567890, RUS --> +79234567890, RUS | ||
// +79234567890, RUS --> +79234567890, RUS | ||
// +79234567890 ---> +79234567890, RUS | ||
// +70234567890, RUS ---> invalid | ||
// 9234567890, RUS ---> +79234567890, RUS | ||
describe('Testing RUS Phone Quick Test', function() { | ||
describe('Test 1', function() { | ||
var number = '89234567890',// remove the 8, treat it as 9234567890 | ||
country = 'RUS', | ||
result = ['+79234567890', 'RUS']; | ||
it('returns ' + result, function() { | ||
phone(number, country).should.eql(result); | ||
}); | ||
}); | ||
}); | ||
describe('Test 2', function() { | ||
var number = '+79234567890', | ||
country = 'RUS', | ||
result = ['+79234567890', 'RUS']; | ||
it('returns ' + result, function() { | ||
phone(number, country).should.eql(result); | ||
}); | ||
}); | ||
describe('Test 3', function() { | ||
var number = '+79234567890', | ||
country = '', | ||
result = ['+79234567890', 'RUS']; | ||
it('returns ' + result, function() { | ||
phone(number, country).should.eql(result); | ||
}); | ||
}); | ||
describe('Testing UK Phone', function() { | ||
// return null, as `790` is NOT the USA area code | ||
describe("phone('07902687632', '')", function() { | ||
it('returns null', function() { | ||
var result = (phone('07902687632', '') == null); | ||
result.should.eql(true); | ||
describe('Test 4', function() { | ||
var number = '+70234567890', | ||
country = 'RUS', | ||
result = []; // as 0 is not a valid prefix, must be 9 | ||
it('returns ' + result, function() { | ||
phone(number, country).should.eql(result); | ||
}); | ||
}); | ||
describe("phone('07902687632', null)", function() { | ||
it('returns null', function() { | ||
var result = (phone('07902687632', '') == null); | ||
result.should.eql(true); | ||
describe('Test 5', function() { | ||
var number = '+79234567890', | ||
country = 'USA', | ||
result = []; | ||
it('returns ' + result, function() { | ||
phone(number, country).should.eql(result); | ||
}); | ||
}); | ||
}); | ||
describe("phone('07902687632', 'GBR')", function() { | ||
it('returns +447902687632', function() { | ||
var result = phone('07902687632', 'GBR'); | ||
result.should.eql('+447902687632'); | ||
describe('Testing THA Phone Quick Test', function() { | ||
describe('Test 1', function() { | ||
var number = '0812345678', // remove the leading 0 | ||
country = 'THA', | ||
result = ['+66812345678', 'THA']; | ||
it('returns ' + result, function() { | ||
phone(number, country).should.eql(result); | ||
}); | ||
}); | ||
describe("phone('06902687632', 'GBR')", function() { | ||
it('returns null', function() { | ||
var result = (phone('06902687632', 'GBR') === null); | ||
// because the UK mobile must start with 7 | ||
result.should.eql(true); | ||
describe('Test 2', function() { | ||
var number = '0912345678', // remove the leading 0 | ||
country = 'THA', | ||
result = ['+66912345678', 'THA']; | ||
it('returns ' + result, function() { | ||
phone(number, country).should.eql(result); | ||
}); | ||
}); | ||
describe('Test 3', function() { | ||
var number = '812345678', | ||
country = 'THA', | ||
result = ['+66812345678', 'THA']; | ||
it('returns ' + result, function() { | ||
phone(number, country).should.eql(result); | ||
}); | ||
}); | ||
}); | ||
}); |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
58628
0
137
815
1
- Removedshould@~3.0.1
- Removedshould@3.0.1(transitive)