From aae1ec2dc60075311b66dbe6bb5af9db6cd63e61 Mon Sep 17 00:00:00 2001 From: Marak Date: Mon, 22 Sep 2014 11:30:10 +0200 Subject: [api] [minor] Add back state_abbr. --- index.js | 4 ++-- lib/address.js | 4 ++++ 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); }, -- cgit v1.2.3