diff options
| author | Marak <[email protected]> | 2014-09-22 11:30:10 +0200 |
|---|---|---|
| committer | Marak <[email protected]> | 2014-09-22 11:30:10 +0200 |
| commit | aae1ec2dc60075311b66dbe6bb5af9db6cd63e61 (patch) | |
| tree | 5c4c6db00c18626007644c74b4841e40c8cb2c7b | |
| parent | ea1dfb4f879e3e900ebeffba2a8455203c82ba1c (diff) | |
| download | faker-aae1ec2dc60075311b66dbe6bb5af9db6cd63e61.tar.xz faker-aae1ec2dc60075311b66dbe6bb5af9db6cd63e61.zip | |
[api] [minor] Add back state_abbr.
| -rw-r--r-- | index.js | 4 | ||||
| -rw-r--r-- | lib/address.js | 4 |
2 files changed, 6 insertions, 2 deletions
@@ -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); }, |
