Skip to content

Commit

Permalink
[dist] Rebuild
Browse files Browse the repository at this point in the history
  • Loading branch information
Marak committed Sep 13, 2014
1 parent 9f3fa0f commit 9424f3e
Show file tree
Hide file tree
Showing 5 changed files with 203 additions and 29 deletions.
2 changes: 1 addition & 1 deletion Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

## API

<ul><li>Name<ul><li>firstName</li><li>firstNameFemale</li><li>firstNameMale</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><li>phoneCode</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>phone_codes</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>phone_codes</li><li>avatar_uri</li></ul></li></ul>
<ul><li>Name<ul><li>firstName</li><li>firstNameFemale</li><li>firstNameMale</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><li>phoneCode</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><li>createTransaction</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>phone_codes</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>phone_codes</li><li>avatar_uri</li><li>account_type</li><li>transaction_type</li></ul></li><li>Finance<ul><li>account</li><li>accountName</li><li>mask</li><li>amount</li><li>transactionType</li></ul></li></ul>

## Tests
npm install .
Expand Down
109 changes: 98 additions & 11 deletions build/build/faker.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ exports.Tree = require('./lib/tree');
exports.Date = require('./lib/date');
exports.random = require('./lib/random');
exports.definitions = require('./lib/definitions');
exports.Finance = require('./lib/finance');

},{"./lib/address":2,"./lib/company":3,"./lib/date":4,"./lib/definitions":5,"./lib/helpers":6,"./lib/image":7,"./lib/internet":8,"./lib/lorem":9,"./lib/name":10,"./lib/phone_number":11,"./lib/random":12,"./lib/tree":13}],2:[function(require,module,exports){
},{"./lib/address":2,"./lib/company":3,"./lib/date":4,"./lib/definitions":5,"./lib/finance":6,"./lib/helpers":7,"./lib/image":8,"./lib/internet":9,"./lib/lorem":10,"./lib/name":11,"./lib/phone_number":12,"./lib/random":13,"./lib/tree":14}],2:[function(require,module,exports){
var Helpers = require('./helpers');
var faker = require('../index');
var definitions = require('../lib/definitions');
Expand Down Expand Up @@ -133,7 +134,7 @@ var address = {

module.exports = address;

},{"../index":1,"../lib/definitions":5,"./helpers":6}],3:[function(require,module,exports){
},{"../index":1,"../lib/definitions":5,"./helpers":7}],3:[function(require,module,exports){
var faker = require('../index');

var company = {
Expand Down Expand Up @@ -1624,7 +1625,81 @@ for (var i = 0; i < avatarUri.length; i++) {
exports.avatar_uri.push("https://s3.amazonaws.com/uifaces/faces/twitter/" + avatarUri[i]);
};

exports.account_type = ["Checking","Savings","Money Market", "Investment", "Home Loan", "Credit Card", "Auto Loan", "Personal Loan"];

exports.transaction_type = ["deposit", "withdrawal", "payment", "invoice"];
},{}],6:[function(require,module,exports){
var Helpers = require('./helpers');
var definitions = require('./definitions');

var finance = {

account: function (length) {

length = length || 8;

var template = '';

for (var i = 0; i < length; i++) {
template = template + '#';
}
length = null;
return Helpers.replaceSymbolWithNumber(template);
},

accountName: function () {

return [Helpers.randomize(definitions.account_type), 'Account'].join(' ');
},

mask: function (length, parens, elipsis) {


//set defaults
length = (length == 0 || !length || typeof length == 'undefined') ? 4 : length;
parens = (parens === null) ? true : parens;
elipsis = (elipsis === null) ? true : elipsis;

//create a template for length
var template = '';

for (var i = 0; i < length; i++) {
template = template + '#';
}

//prefix with elipsis
template = (elipsis) ? ['...', template].join('') : template;

template = (parens) ? ['(', template, ')'].join('') : template;

//generate random numbers
template = Helpers.replaceSymbolWithNumber(template);

return template;

},

//min and max take in minimum and maximum amounts, dec is the decimal place you want rounded to, symbol is $, €, £, etc
//NOTE: this returns a string representation of the value, if you want a number use parseFloat and no symbol

amount: function (min, max, dec, symbol) {

min = min || 0;
max = max || 1000;
dec = dec || 2;
symbol = symbol || '';

return symbol + (Math.round((Math.random() * (max - min) + min) * Math.pow(10, dec)) / Math.pow(10, dec)).toFixed(dec);

},

transactionType: function () {
return Helpers.randomize(definitions.transaction_type);
}
};

module.exports = finance;
},{"./definitions":5,"./helpers":7}],7:[function(require,module,exports){
var faker = require('../index');

// backword-compatibility
Expand Down Expand Up @@ -1711,7 +1786,8 @@ exports.createCard = function () {
"sentences": faker.Lorem.sentences(),
"paragraph": faker.Lorem.paragraph()
}
]
],
"accountHistory": [faker.Helpers.createTransaction(), faker.Helpers.createTransaction(), faker.Helpers.createTransaction()]
};
};

Expand Down Expand Up @@ -1741,6 +1817,16 @@ exports.userCard = function () {
};
};

exports.createTransaction = function(){
return {
"amount" : faker.Finance.amount(),
"date" : new Date(2012, 1, 2), //TODO: add a ranged date method
"business": faker.Company.companyName(),
"name": [faker.Finance.accountName(), faker.Finance.mask()].join(' '),
"type" : exports.randomize(faker.definitions.transaction_type),
"account" : faker.Finance.account()
};
};

/*
String.prototype.capitalize = function () { //v1.0
Expand All @@ -1750,7 +1836,8 @@ String.prototype.capitalize = function () { //v1.0
};
*/

},{"../index":1}],7:[function(require,module,exports){

},{"../index":1}],8:[function(require,module,exports){
var faker = require('../index');

var image = {
Expand Down Expand Up @@ -1810,7 +1897,7 @@ var image = {

module.exports = image;

},{"../index":1}],8:[function(require,module,exports){
},{"../index":1}],9:[function(require,module,exports){
var faker = require('../index');

var internet = {
Expand Down Expand Up @@ -1865,7 +1952,7 @@ var internet = {

module.exports = internet;

},{"../index":1}],9:[function(require,module,exports){
},{"../index":1}],10:[function(require,module,exports){
var faker = require('../index');
var Helpers = require('./helpers');
var definitions = require('../lib/definitions');
Expand Down Expand Up @@ -1912,7 +1999,7 @@ var lorem = {

module.exports = lorem;

},{"../index":1,"../lib/definitions":5,"./helpers":6}],10:[function(require,module,exports){
},{"../index":1,"../lib/definitions":5,"./helpers":7}],11:[function(require,module,exports){
var faker = require('../index');

var _name = {
Expand Down Expand Up @@ -1948,7 +2035,7 @@ var _name = {

module.exports = _name;

},{"../index":1}],11:[function(require,module,exports){
},{"../index":1}],12:[function(require,module,exports){
var faker = require('../index');
var Helpers = require('./helpers');
var definitions = require('./definitions');
Expand All @@ -1971,7 +2058,7 @@ var phone = {

module.exports = phone;

},{"../index":1,"./definitions":5,"./helpers":6}],12:[function(require,module,exports){
},{"../index":1,"./definitions":5,"./helpers":7}],13:[function(require,module,exports){
var definitions = require('./definitions');
var mersenne = require('../vendor/mersenne');
var faker = require('../index');
Expand Down Expand Up @@ -2112,7 +2199,7 @@ var random = {

module.exports = random;

},{"../index":1,"../vendor/mersenne":14,"./definitions":5}],13:[function(require,module,exports){
},{"../index":1,"../vendor/mersenne":15,"./definitions":5}],14:[function(require,module,exports){
var faker = require('../index');

var tree = {
Expand Down Expand Up @@ -2183,7 +2270,7 @@ var tree = {

module.exports = tree;

},{"../index":1}],14:[function(require,module,exports){
},{"../index":1}],15:[function(require,module,exports){
// this program is a JavaScript version of Mersenne Twister, with concealment and encapsulation in class,
// an almost straight conversion from the original program, mt19937ar.c,
// translated by y. okada on July 17, 2006.
Expand Down
6 changes: 3 additions & 3 deletions build/build/faker.min.js

Large diffs are not rendered by default.

Loading

0 comments on commit 9424f3e

Please sign in to comment.