aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarak <[email protected]>2014-09-22 11:30:10 +0200
committerMarak <[email protected]>2014-09-22 11:30:10 +0200
commitaae1ec2dc60075311b66dbe6bb5af9db6cd63e61 (patch)
tree5c4c6db00c18626007644c74b4841e40c8cb2c7b
parentea1dfb4f879e3e900ebeffba2a8455203c82ba1c (diff)
downloadfaker-aae1ec2dc60075311b66dbe6bb5af9db6cd63e61.tar.xz
faker-aae1ec2dc60075311b66dbe6bb5af9db6cd63e61.zip
[api] [minor] Add back state_abbr.
-rw-r--r--index.js4
-rw-r--r--lib/address.js4
2 files changed, 6 insertions, 2 deletions
diff --git a/index.js b/index.js
index c06071bc..f3bc4291 100644
--- a/index.js
+++ b/index.js
@@ -42,13 +42,13 @@ exports.definitions = {};
var _definitions = {
"name": ["first_name", "last_name", "prefix", "suffix"],
- "address": ["city_prefix", "city_suffix", "street_suffix", "county", "country", "state"],
+ "address": ["city_prefix", "city_suffix", "street_suffix", "county", "country", "state", "state_abbr"],
"company": ["adjective", "noun", "descriptor", "bs_adjective", "bs_noun", "bs_verb"],
"lorem": ["words"],
"hacker": ["abbreviation", "adjective", "noun", "verb", "ingverb"],
"phone_number": ["formats"],
- "internet": ["avatar_uri", "domain_suffix", "free_email"],
"finance": ["account_type", "transaction_type", "currency"],
+ "internet": ["avatar_uri", "domain_suffix", "free_email", "password"]
};
// Create a Getter for all definitions.foo.bar propetries
diff --git a/lib/address.js b/lib/address.js
index 38b2ce5e..a23374ba 100644
--- a/lib/address.js
+++ b/lib/address.js
@@ -91,6 +91,10 @@ var address = {
return faker.random.array_element(faker.definitions.address.state);
},
+ state_abbr: function () {
+ return faker.random.array_element(faker.definitions.address.state_abbr);
+ },
+
latitude: function () {
return (faker.random.number(180 * 10000) / 10000.0 - 90.0).toFixed(4);
},