Repository: validatorjs/validator.js (js)

Issue:
Add stricter Ecuador phone number validation
Following the comments on #1187, certain digit combinations are not valid. According to the [ITU document about Ecuador National Numbering plans](https://www.itu.int/dms_pub/itu-t/oth/02/02/T020200003D0001PDFE.pdf) there are a couple of missing rules:

- 9 digits numbers are only valid if the first digit is 9.
- Cellphone numbers start with a network code between 92 and 99, so cellphone numbers starting with 90 and 91 are invalid

A PR is coming shorty to address this issue.


Pull request description:
Enforce stricter Ecuador phone number validation
This will enforce stricter Ecuador phone number validation. @tux-tn
Closes #1190

Patch:
diff --git a/src/lib/isMobilePhone.js b/src/lib/isMobilePhone.js
index 7b4f046..2e5d7a7 100644
--- a/src/lib/isMobilePhone.js
+++ b/src/lib/isMobilePhone.js
@@ -41,7 +41,7 @@ const phones = {
   'en-ZA': /^(\+?27|0)\d{9}$/,
   'en-ZM': /^(\+?26)?09[567]\d{7}$/,
   'es-CL': /^(\+?56|0)[2-9]\d{1}\d{7}$/,
-  'es-EC': /^(\+?593|0)[2-7,9]\d{7,8}$/,
+  'es-EC': /^(\+?593|0)([2-7]|9[2-9])\d{7}$/,
   'es-ES': /^(\+?34)?(6\d{1}|7[1234])\d{7}$/,
   'es-MX': /^(\+?52)?(1|01)?\d{10,11}$/,
   'es-PA': /^(\+?507)\d{7,8}$/,


Test patch:
diff --git a/test/validators.js b/test/validators.js
index f78edf9..8ac0e9f 100644
--- a/test/validators.js
+++ b/test/validators.js
@@ -4644,10 +4644,11 @@ describe('Validators', () => {
       {
         locale: 'es-EC',
         valid: [
-          '+593995414585',
-          '593912345677',
-          '0915114585',
+          '+593987654321',
+          '593987654321',
+          '0987654321',
           '027332615',
+          '+59323456789',
         ],
         invalid: [
           '03321321',
@@ -4656,6 +4657,10 @@ describe('Validators', () => {
           '02344635',
           '593123456789',
           '081234567',
+          '+593912345678',
+          '+593902345678',
+          '+593287654321',
+          '593287654321',
         ],
       },
       {