Comparing version 0.6.2 to 0.7.0
@@ -8,10 +8,2 @@ var Faker = require('../index'); | ||
firstNameMale: function () { | ||
return Faker.random.first_name_male(); | ||
}, | ||
firstNameFemale: function () { | ||
return Faker.random.first_name_female(); | ||
}, | ||
lastName: function () { | ||
@@ -24,13 +16,9 @@ return Faker.random.last_name(); | ||
switch (r) { | ||
case 0: | ||
return Faker.random.name_prefix() + " " + this.firstName() + " " + this.lastName(); | ||
case 1: | ||
return this.firstName() + " " + this.lastName() + " " + Faker.random.name_suffix(); | ||
case 0: | ||
return Faker.random.name_prefix() + " " + this.firstName() + " " + this.lastName(); | ||
case 1: | ||
return this.firstName() + " " + this.lastName() + " " + Faker.random.name_suffix(); | ||
} | ||
return this.firstName() + " " + this.lastName(); | ||
}, | ||
gender: function () { | ||
return Faker.random.gender(); | ||
} | ||
@@ -37,0 +25,0 @@ }; |
@@ -51,6 +51,2 @@ var definitions = require('./definitions'); | ||
gender: function () { | ||
return this.array_element([ "male", "female" ]); | ||
}, | ||
first_name: function () { | ||
@@ -60,10 +56,2 @@ return this.array_element(definitions.first_name); | ||
first_name_female: function () { | ||
return this.array_element(definitions.first_name_female); | ||
}, | ||
first_name_male: function () { | ||
return this.array_element(definitions.first_name_male); | ||
}, | ||
last_name: function () { | ||
@@ -70,0 +58,0 @@ return this.array_element(definitions.last_name); |
{ | ||
"name": "Faker", | ||
"description": "Generate massive amounts of fake contextual data", | ||
"version": "0.6.2", | ||
"version": "0.7.0", | ||
"contributors": [ | ||
@@ -6,0 +6,0 @@ "Marak Squires <marak.squires@gmail.com>", |
@@ -18,3 +18,3 @@ # Faker.js - generate massive amounts of fake data in the browser and node.js | ||
## API | ||
<ul><li>Name<ul><li>firstName</li><li>firstNameMale</li><li>firstNameFemale</li><li>lastName</li><li>findName</li><li>gender</li></ul></li><li>Address<ul><li>zipCode</li><li>zipCodeFormat</li><li>city</li><li>streetName</li><li>streetAddress</li><li>secondaryAddress</li><li>brState</li><li>ukCounty</li><li>ukCountry</li><li>usState</li><li>latitude</li><li>longitude</li></ul></li><li>PhoneNumber<ul><li>phoneNumber</li><li>phoneNumberFormat</li></ul></li><li>Internet<ul><li>email</li><li>userName</li><li>domainName</li><li>domainWord</li><li>ip</li><li>color</li></ul></li><li>Company<ul><li>suffixes</li><li>companyName</li><li>companySuffix</li><li>catchPhrase</li><li>bs</li></ul></li><li>Image<ul><li>avatar</li><li>imageUrl</li><li>abstractImage</li><li>animals</li><li>business</li><li>cats</li><li>city</li><li>food</li><li>nightlife</li><li>fashion</li><li>people</li><li>nature</li><li>sports</li><li>technics</li><li>transport</li></ul></li><li>Lorem<ul><li>words</li><li>sentence</li><li>sentences</li><li>paragraph</li><li>paragraphs</li></ul></li><li>Helpers<ul><li>randomNumber</li><li>randomize</li><li>slugify</li><li>replaceSymbolWithNumber</li><li>shuffle</li><li>createCard</li><li>userCard</li></ul></li><li>Tree<ul><li>clone</li><li>createTree</li></ul></li><li>Date<ul><li>past</li><li>future</li><li>between</li><li>recent</li></ul></li><li>random<ul><li>number</li><li>array_element</li><li>city_prefix</li><li>city_suffix</li><li>street_suffix</li><li>br_state</li><li>br_state_abbr</li><li>us_state</li><li>us_state_abbr</li><li>uk_county</li><li>uk_country</li><li>gender</li><li>first_name</li><li>first_name_female</li><li>first_name_male</li><li>last_name</li><li>name_prefix</li><li>name_suffix</li><li>catch_phrase_adjective</li><li>catch_phrase_descriptor</li><li>catch_phrase_noun</li><li>bs_adjective</li><li>bs_buzz</li><li>bs_noun</li><li>phone_formats</li><li>domain_suffix</li><li>avatar_uri</li></ul></li><li>definitions<ul><li>first_name_male</li><li>first_name_female</li><li>first_name</li><li>last_name</li><li>name_prefix</li><li>name_suffix</li><li>br_state</li><li>br_state_abbr</li><li>us_state</li><li>us_state_abbr</li><li>city_prefix</li><li>city_suffix</li><li>street_suffix</li><li>uk_county</li><li>uk_country</li><li>catch_phrase_adjective</li><li>catch_phrase_descriptor</li><li>catch_phrase_noun</li><li>bs_adjective</li><li>bs_buzz</li><li>bs_noun</li><li>domain_suffix</li><li>lorem</li><li>phone_formats</li><li>avatar_uri</li></ul></li></ul> | ||
<ul><li>Name<ul><li>firstName</li><li>lastName</li><li>findName</li></ul></li><li>Address<ul><li>zipCode</li><li>zipCodeFormat</li><li>city</li><li>streetName</li><li>streetAddress</li><li>secondaryAddress</li><li>brState</li><li>ukCounty</li><li>ukCountry</li><li>usState</li><li>latitude</li><li>longitude</li></ul></li><li>PhoneNumber<ul><li>phoneNumber</li><li>phoneNumberFormat</li></ul></li><li>Internet<ul><li>email</li><li>userName</li><li>domainName</li><li>domainWord</li><li>ip</li><li>color</li></ul></li><li>Company<ul><li>suffixes</li><li>companyName</li><li>companySuffix</li><li>catchPhrase</li><li>bs</li></ul></li><li>Image<ul><li>avatar</li><li>imageUrl</li><li>abstractImage</li><li>animals</li><li>business</li><li>cats</li><li>city</li><li>food</li><li>nightlife</li><li>fashion</li><li>people</li><li>nature</li><li>sports</li><li>technics</li><li>transport</li></ul></li><li>Lorem<ul><li>words</li><li>sentence</li><li>sentences</li><li>paragraph</li><li>paragraphs</li></ul></li><li>Helpers<ul><li>randomNumber</li><li>randomize</li><li>slugify</li><li>replaceSymbolWithNumber</li><li>shuffle</li><li>createCard</li><li>userCard</li></ul></li><li>Tree<ul><li>clone</li><li>createTree</li></ul></li><li>Date<ul><li>past</li><li>future</li><li>between</li><li>recent</li></ul></li><li>random<ul><li>number</li><li>array_element</li><li>city_prefix</li><li>city_suffix</li><li>street_suffix</li><li>br_state</li><li>br_state_abbr</li><li>us_state</li><li>us_state_abbr</li><li>uk_county</li><li>uk_country</li><li>first_name</li><li>last_name</li><li>name_prefix</li><li>name_suffix</li><li>catch_phrase_adjective</li><li>catch_phrase_descriptor</li><li>catch_phrase_noun</li><li>bs_adjective</li><li>bs_buzz</li><li>bs_noun</li><li>phone_formats</li><li>domain_suffix</li><li>avatar_uri</li></ul></li><li>definitions<ul><li>first_name</li><li>last_name</li><li>name_prefix</li><li>name_suffix</li><li>br_state</li><li>br_state_abbr</li><li>us_state</li><li>us_state_abbr</li><li>city_prefix</li><li>city_suffix</li><li>street_suffix</li><li>uk_county</li><li>uk_country</li><li>catch_phrase_adjective</li><li>catch_phrase_descriptor</li><li>catch_phrase_noun</li><li>bs_adjective</li><li>bs_buzz</li><li>bs_noun</li><li>domain_suffix</li><li>lorem</li><li>phone_formats</li><li>avatar_uri</li></ul></li></ul> | ||
## Tests | ||
@@ -21,0 +21,0 @@ npm install . |
@@ -17,3 +17,3 @@ var fs = require( "fs" ); | ||
output = "module.exports = [\n '" + names.join( "',\n '" ) + "'\n];\n"; | ||
output = "module.exports = [ '" + names.join( "', '" ) + "' ];"; | ||
@@ -20,0 +20,0 @@ fs.writeFileSync( __dirname + "/" + outputFile, output ); |
@@ -20,29 +20,3 @@ if (typeof module !== 'undefined') { | ||
describe("firstNameMale()", function () { | ||
it("returns a random male name", function () { | ||
var first_name = Faker.Name.firstNameMale(); | ||
console.log(first_name); | ||
assert.ok(first_name); | ||
}); | ||
}); | ||
describe("firstNameFemale()", function () { | ||
it("returns a random female name", function () { | ||
var first_name = Faker.Name.firstNameFemale(); | ||
console.log(first_name); | ||
assert.ok(first_name); | ||
}); | ||
}); | ||
describe("gender()", function () { | ||
it("returns a random gender", function () { | ||
var gender = Faker.Name.gender(); | ||
assert.ok(gender === 'male' || gender === 'female'); | ||
}); | ||
}); | ||
describe("lastName()", function () { | ||
@@ -49,0 +23,0 @@ it("returns a random name", function () { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
1098653
13533