diff --git a/CHANGELOG.md b/CHANGELOG.md index 549377fd2..20b509446 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -212,7 +212,7 @@ - [#1922](https://github.com/validatorjs/validator.js/pull/1922) `ir-IR`, @ArashST79 - [#1924](https://github.com/validatorjs/validator.js/pull/1924) `ky-KG`, @arsalanfiroozi - [#1925](https://github.com/validatorjs/validator.js/pull/1925) `ar-YE`, `ar-EH`, `fa-AF`, @Mustafiz04 - - [#1932](https://github.com/validatorjs/validator.js/pull/1932) `ro-MD`, @mik7up + - [#1932](https://github.com/validatorjs/validator.js/pull/1932) `md-MD`, @mik7up - [#1940](https://github.com/validatorjs/validator.js/pull/1940) `ar-YE`, `en-BS`, @savannahvaith - [#1952](https://github.com/validatorjs/validator.js/pull/1952) `ka-GE`, @avkvak - [#1964](https://github.com/validatorjs/validator.js/pull/1964) [#1951](https://github.com/validatorjs/validator.js/pull/1951) `pt-BR`, @jhcaiafa @matheusnascgomes diff --git a/src/lib/isMobilePhone.js b/src/lib/isMobilePhone.js index b00391ea6..49312860a 100644 --- a/src/lib/isMobilePhone.js +++ b/src/lib/isMobilePhone.js @@ -138,7 +138,7 @@ const phones = { 'pt-BR': /^((\+?55\ ?[1-9]{2}\ ?)|(\+?55\ ?\([1-9]{2}\)\ ?)|(0[1-9]{2}\ ?)|(\([1-9]{2}\)\ ?)|([1-9]{2}\ ?))((\d{4}\-?\d{4})|(9[1-9]{1}\d{3}\-?\d{4}))$/, 'pt-PT': /^(\+?351)?9[1236]\d{7}$/, 'pt-AO': /^(\+?244)?9\d{8}$/, - 'ro-MD': /^(\+?373|0)((6(0|1|2|6|7|8|9))|(7(6|7|8|9)))\d{6}$/, + 'md-MD': /^(\+?373|0)((6(0|1|2|6|7|8|9))|(7(6|7|8|9)))\d{6}$/, 'ro-RO': /^(\+?40|0)\s?7\d{2}(\/|\s|\.|-)?\d{3}(\s|\.|-)?\d{3}$/, 'ru-RU': /^(\+?7|8)?9\d{9}$/, 'si-LK': /^(?:0|94|\+94)?(7(0|1|2|4|5|6|7|8)( |-)?)\d{7}$/, diff --git a/test/validators.test.js b/test/validators.test.js index f73a48164..58a105298 100644 --- a/test/validators.test.js +++ b/test/validators.test.js @@ -9995,7 +9995,7 @@ describe('Validators', () => { ], }, { - locale: 'ro-MD', + locale: 'md-MD', valid: [ '+37360375781', '+37361945673',