aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshadefinale <[email protected]>2015-11-11 12:09:34 -0600
committershadefinale <[email protected]>2015-11-11 12:09:34 -0600
commitff044ed9c4153e59c45b109709e054daf7944db9 (patch)
tree4ec1447af55ce7a4ddf9deebf36f89f876151c3f
parent4c6a3f30c8ff481a81a66d0ec28b0d65852411c2 (diff)
downloadfaker-ff044ed9c4153e59c45b109709e054daf7944db9.tar.xz
faker-ff044ed9c4153e59c45b109709e054daf7944db9.zip
Edit locales and replaceSymbolwithNumber for more accurate US/CA phone numbers.
-rw-r--r--lib/locales/en/phone_number/formats.js40
-rw-r--r--lib/locales/en_CA/phone_number/formats.js30
-rw-r--r--test/phone_number.unit.js4
3 files changed, 37 insertions, 37 deletions
diff --git a/lib/locales/en/phone_number/formats.js b/lib/locales/en/phone_number/formats.js
index 2eb1f5f9..d3eec219 100644
--- a/lib/locales/en/phone_number/formats.js
+++ b/lib/locales/en/phone_number/formats.js
@@ -1,22 +1,22 @@
module["exports"] = [
- "###-!##-####",
- "(!##) ###-####",
- "1-!##-###-####",
- "!##.###.####",
- "!##-###-####",
- "(!##) ###-####",
- "1-!##-###-####",
- "!##.###.####",
- "!##-###-#### x###",
- "(!##) ###-#### x###",
- "1-!##-###-#### x###",
- "!##.###.#### x###",
- "!##-###-#### x####",
- "(!##) ###-#### x####",
- "1-!##-###-#### x####",
- "!##.###.#### x####",
- "!##-###-#### x#####",
- "(!##) ###-#### x#####",
- "1-!##-###-#### x#####",
- "!##.###.#### x#####"
+ "!##-!##-####",
+ "(!##) !##-####",
+ "1-!##-!##-####",
+ "!##.!##.####",
+ "!##-!##-####",
+ "(!##) !##-####",
+ "1-!##-!##-####",
+ "!##.!##.####",
+ "!##-!##-#### x###",
+ "(!##) !##-#### x###",
+ "1-!##-!##-#### x###",
+ "!##.!##.#### x###",
+ "!##-!##-#### x####",
+ "(!##) !##-#### x####",
+ "1-!##-!##-#### x####",
+ "!##.!##.#### x####",
+ "!##-!##-#### x#####",
+ "(!##) !##-#### x#####",
+ "1-!##-!##-#### x#####",
+ "!##.!##.#### x#####"
];
diff --git a/lib/locales/en_CA/phone_number/formats.js b/lib/locales/en_CA/phone_number/formats.js
index d73d6826..c5b85ebe 100644
--- a/lib/locales/en_CA/phone_number/formats.js
+++ b/lib/locales/en_CA/phone_number/formats.js
@@ -1,18 +1,18 @@
module["exports"] = [
- "!##-###-####",
- "(!##)###-####",
- "!##.###.####",
+ "!##-!##-####",
+ "(!##)!##-####",
+ "!##.!##.####",
"1-!##-###-####",
- "!##-###-#### x###",
- "(!##)###-#### x###",
- "1-!##-###-#### x###",
- "!##.###.#### x###",
- "!##-###-#### x####",
- "(!##)###-#### x####",
- "1-!##-###-#### x####",
- "!##.###.#### x####",
- "!##-###-#### x#####",
- "(!##)###-#### x#####",
- "1-!##-###-#### x#####",
- "!##.###.#### x#####"
+ "!##-!##-#### x###",
+ "(!##)!##-#### x###",
+ "1-!##-!##-#### x###",
+ "!##.!##.#### x###",
+ "!##-!##-#### x####",
+ "(!##)!##-#### x####",
+ "1-!##-!##-#### x####",
+ "!##.!##.#### x####",
+ "!##-!##-#### x#####",
+ "(!##)!##-#### x#####",
+ "1-!##-!##-#### x#####",
+ "!##.!##.#### x#####"
];
diff --git a/test/phone_number.unit.js b/test/phone_number.unit.js
index 5cd4aba5..442a602a 100644
--- a/test/phone_number.unit.js
+++ b/test/phone_number.unit.js
@@ -31,7 +31,7 @@ describe("phone_number.js", function () {
for (var i = 0; i < 25; i++) {
var phone_number = faker.phone.phoneNumberFormat(1);
console.log(phone_number)
- assert.ok(phone_number.match(/\([2-9]\d\d\) \d\d\d-\d\d\d\d/));
+ assert.ok(phone_number.match(/\([2-9]\d\d\) [2-9]\d\d-\d\d\d\d/));
}
});
@@ -39,7 +39,7 @@ describe("phone_number.js", function () {
faker.locale = "en_CA";
for (var i = 0; i < 25; i++) {
var phone_number = faker.phone.phoneNumberFormat(1);
- assert.ok(phone_number.match(/\([2-9]\d\d\)\d\d\d-\d\d\d\d/));
+ assert.ok(phone_number.match(/\([2-9]\d\d\)[2-9]\d\d-\d\d\d\d/));
}
});