forked from zuriby/Faker.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[refactor] [major] Renamed variable names for consistency Closes #5
[refactor [major] Moved all errant methods from random.js to individual modules. Methods in random.js were causing unnecessary code complication.
- Loading branch information
Showing
28 changed files
with
514 additions
and
531 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,9 +7,9 @@ | |
|
||
<script src = "faker.js" type = "text/javascript"></script> | ||
<script> | ||
var randomName = faker.Name.findName(); // Caitlyn Kerluke | ||
var randomEmail = faker.Internet.email(); // [email protected] | ||
var randomCard = faker.Helpers.createCard(); // random contact card containing many properties | ||
var randomName = faker.name.findName(); // Caitlyn Kerluke | ||
var randomEmail = faker.internet.email(); // [email protected] | ||
var randomCard = faker.helpers.createCard(); // random contact card containing many properties | ||
</script> | ||
|
||
### node.js - | ||
|
@@ -18,9 +18,9 @@ | |
|
||
var faker = require('./faker'); | ||
|
||
var randomName = faker.Name.findName(); // Rowan Nikolaus | ||
var randomEmail = faker.Internet.email(); // [email protected] | ||
var randomCard = faker.Helpers.createCard(); // random contact card containing many properties | ||
var randomName = faker.name.findName(); // Rowan Nikolaus | ||
var randomEmail = faker.internet.email(); // [email protected] | ||
var randomCard = faker.helpers.createCard(); // random contact card containing many properties | ||
|
||
|
||
## API | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,62 @@ | ||
var faker = require('../index'); | ||
|
||
var company = { | ||
|
||
suffixes: function () { | ||
return ["Inc", "and Sons", "LLC", "Group", "and Daughters"]; | ||
}, | ||
|
||
companyName: function (format) { | ||
switch ((format ? format : faker.random.number(2))) { | ||
case 0: | ||
return faker.Name.lastName() + " " + faker.Company.companySuffix(); | ||
return faker.name.lastName() + " " + faker.company.companySuffix(); | ||
case 1: | ||
return faker.Name.lastName() + "-" + faker.Name.lastName(); | ||
return faker.name.lastName() + "-" + faker.name.lastName(); | ||
case 2: | ||
return faker.Name.lastName() + ", " + faker.Name.lastName() + " and " + faker.Name.lastName(); | ||
return faker.name.lastName() + ", " + faker.name.lastName() + " and " + faker.name.lastName(); | ||
} | ||
}, | ||
|
||
companySuffix: function () { | ||
return faker.random.array_element(faker.Company.suffixes()); | ||
return faker.random.array_element(faker.company.suffixes()); | ||
}, | ||
|
||
catchPhrase: function () { | ||
return faker.random.catch_phrase_adjective() + " " + | ||
faker.random.catch_phrase_descriptor() + " " + | ||
faker.random.catch_phrase_noun(); | ||
return faker.company.catchPhraseAdjective() + " " + | ||
faker.company.catchPhraseDescriptor() + " " + | ||
faker.company.catchPhraseNoun(); | ||
}, | ||
|
||
bs: function () { | ||
return faker.random.bs_adjective() + " " + | ||
faker.random.bs_buzz() + " " + | ||
faker.random.bs_noun(); | ||
return faker.company.bsAdjective() + " " + | ||
faker.company.bsBuzz() + " " + | ||
faker.company.bsNoun(); | ||
}, | ||
|
||
catchPhraseAdjective: function () { | ||
return faker.random.array_element(faker.definitions.catch_phrase_adjective); | ||
}, | ||
|
||
catchPhraseDescriptor: function () { | ||
return faker.random.array_element(faker.definitions.catch_phrase_descriptor); | ||
}, | ||
|
||
catchPhraseNoun: function () { | ||
return faker.random.array_element(faker.definitions.catch_phrase_noun); | ||
}, | ||
|
||
bsAdjective: function () { | ||
return faker.random.array_element(faker.definitions.bs_adjective); | ||
}, | ||
|
||
bsBuzz: function () { | ||
return faker.random.array_element(faker.definitions.bs_buzz); | ||
}, | ||
|
||
bsNoun: function () { | ||
return faker.random.array_element(faker.definitions.bs_noun); | ||
} | ||
|
||
}; | ||
|
||
module.exports = company; |
Oops, something went wrong.