aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMQuy <[email protected]>2014-09-08 11:42:46 +0700
committerMarak <[email protected]>2014-09-09 01:22:26 +0200
commitfa8267f2ce1a41a2684f10c5e2109faff837a0f9 (patch)
tree295cec8c4170c3cf763e4e7d0c3361271a86baf1 /lib
parent3caea6078c05dd7caaffa4d2fd362ebe084168f9 (diff)
downloadfaker-fa8267f2ce1a41a2684f10c5e2109faff837a0f9.tar.xz
faker-fa8267f2ce1a41a2684f10c5e2109faff837a0f9.zip
add faker for phone code
Conflicts: lib/definitions.js
Diffstat (limited to 'lib')
-rw-r--r--lib/definitions.js3
-rw-r--r--lib/phone_number.js5
-rw-r--r--lib/random.js3
3 files changed, 10 insertions, 1 deletions
diff --git a/lib/definitions.js b/lib/definitions.js
index 4525fdf1..36bde57d 100644
--- a/lib/definitions.js
+++ b/lib/definitions.js
@@ -128,6 +128,7 @@ exports.phone_formats = [
'###.###.#### x#####'
];
+exports.phone_codes = ["+1", "+62", "+65", "+20", "+212", "+213", "+216", "+218", "+220", "+221", "+222", "+223", "+224", "+225", "+226", "+227", "+228", "+229", "+230", "+231", "+232", "+233", "+234", "+235", "+236", "+237", "+238", "+239", "+240", "+241", "+242", "+243", "+244", "+245", "+248", "+249", "+250", "+251", "+252", "+253", "+254", "+255", "+256", "+257", "+258", "+260", "+261", "+262", "+263", "+264", "+265", "+266", "+267", "+268", "+269", "+27", "+290", "+291", "+297", "+298", "+299", "+30", "+31", "+32", "+33", "+34", "+350", "+351", "+352", "+353", "+354", "+355", "+356", "+357", "+358", "+359", "+36", "+370", "+371", "+372", "+373", "+374", "+375", "+376", "+377", "+378", "+380", "+381", "+382", "+385", "+386", "+387", "+389", "+39", "+40", "+41", "+420", "+421", "+423", "+43", "+44", "+45", "+46", "+47", "+48", "+49", "+500", "+501", "+502", "+503", "+504", "+505", "+506", "+507", "+508", "+509", "+51", "+52", "+53", "+54", "+55", "+56", "+57", "+58", "+590", "+591", "+592", "+593", "+594", "+595", "+596", "+597", "+598", "+599", "+60", "+61", "+618", "+63", "+64", "+66", "+670", "+672", "+673", "+674", "+675", "+676", "+677", "+678", "+679", "+680", "+681", "+682", "+683", "+685", "+686", "+687", "+688", "+689", "+690", "+691", "+692", "+7", "+808", "+81", "+82", "+84", "+850", "+852", "+853", "+855", "+856", "+86", "+872", "+880", "+886", "+90", "+91", "+92", "+93", "+94", "+95", "+960", "+961", "+962", "+963", "+964", "+965", "+966", "+967", "+968", "+970", "+971", "+972", "+973", "+974", "+975", "+976", "+977", "+98", "+992", "+993", "+994", "+995", "+996", "+998"];
//All this avatar have been authorized by its awesome users to be use on live websites (not just mockups)
//For more information, please visit: http://uifaces.com/authorized
@@ -1403,4 +1404,4 @@ exports.avatar_uri = [];
for (var i = 0; i < avatarUri.length; i++) {
exports.avatar_uri.push("https://s3.amazonaws.com/uifaces/faces/twitter/" + avatarUri[i]);
- }; \ No newline at end of file
+ };
diff --git a/lib/phone_number.js b/lib/phone_number.js
index 2685b528..cc8d9e10 100644
--- a/lib/phone_number.js
+++ b/lib/phone_number.js
@@ -10,7 +10,12 @@ var phone = {
// FIXME: this is strange passing in an array index.
phoneNumberFormat: function (phoneFormatsArrayIndex) {
return Helpers.replaceSymbolWithNumber(definitions.phone_formats[phoneFormatsArrayIndex]);
+ },
+
+ phoneCode: function () {
+ return faker.random.phone_codes();
}
+
};
module.exports = phone;
diff --git a/lib/random.js b/lib/random.js
index c96acaf9..c7386733 100644
--- a/lib/random.js
+++ b/lib/random.js
@@ -97,6 +97,9 @@ var random = {
return faker.random.array_element(definitions.phone_formats);
},
+ phone_codes: function () {
+ return this.array_element(definitions.phone_codes);
+ },
domain_suffix: function () {
return faker.random.array_element(definitions.domain_suffix);
},