From 45ab35ae016140140f6ab5407296cc286dea00d5 Mon Sep 17 00:00:00 2001 From: Bossa573 Date: Wed, 18 Aug 2021 11:00:00 +0800 Subject: [PATCH] Bump to 3.1.5 - https://github.com/AfterShip/phone/pull/253 Fix Argentinian mobile numbers length --- __tests__/data.csv | 6 +++++- package.json | 2 +- src/data/country_phone_data.ts | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/__tests__/data.csv b/__tests__/data.csv index 5f1d858..4348b21 100644 --- a/__tests__/data.csv +++ b/__tests__/data.csv @@ -106,7 +106,11 @@ input_phone,input_country,not_validate_prefix,output_phone,output_country_alpha2 +86 166 51343779,,,+8616651343779,CN,CHN,+86,true,,Test for pattern 166,"returns +8616651343779,CHN", +54 233 123 4567,,,+542331234567,AR,ARG,+54,true,Testing ARG numbers,Test for number without 9 prefix,"returns +542331234567,ARG", +54 9 233 123 4567,,,+542331234567,AR,ARG,+54,true,,Test for number with 9 prefix,"returns +542331234567,ARG", -+54 15 233 123 4567,,,,,,,false,,Test for number with 15 prefix,"returns ", ++54 13 123 456,,,+5413123456,AR,ARG,+54,true,,Test for number with 2 + 6 digit,"returns +5413123456,ARG", ++54 13 123 4567,,,+54131234567,AR,ARG,+54,true,,Test for number with 2 + 7 digit,"returns +54131234567,ARG", ++54 13 123 45678,,,+541312345678,AR,ARG,+54,true,,Test for number with 2 + 8 digit,"returns +541312345678,ARG", ++54 133 123 45678,,,+5413312345678,AR,ARG,+54,true,,Test for number with 3 + 8 digit,"returns +5413312345678,ARG", ++54 1334 123 45678,,,+54133412345678,AR,ARG,+54,true,,Test for number with 4 + 8 digit,"returns +54133412345678,ARG", +299 555299,,,+299555299,GL,GRL,+299,true,Testing GRL numbers,Test for numbers starting with 5,"returns +299555299,GRL", +299 233299,,,+299233299,GL,GRL,+299,true,,Test for numbers starting with 2,"returns +299233299,GRL", +299 321000,,,,,,,false,,Test for landlines,"returns ", diff --git a/package.json b/package.json index 43cf0a8..271a68e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "phone", - "version": "3.1.4", + "version": "3.1.5", "description": "With a given country and phone number, validate and format the phone number to E.164 standard", "main": "./dist/index.js", "types": "./dist/index.d.ts", diff --git a/src/data/country_phone_data.ts b/src/data/country_phone_data.ts index 13d892d..b7000c2 100644 --- a/src/data/country_phone_data.ts +++ b/src/data/country_phone_data.ts @@ -100,7 +100,7 @@ export default [ country_code: '54', country_name: 'Argentina', mobile_begin_with: ['1', '2', '3'], // Same for mobile and landlines - phone_number_lengths: [10] + phone_number_lengths: [8, 9, 10, 11, 12] }, { alpha2: 'AM',