Skip to content

Commit

Permalink
[dist] Rebuild for new version
Browse files Browse the repository at this point in the history
  • Loading branch information
Marak committed Feb 21, 2017
1 parent 0b60bf7 commit cf877ea
Show file tree
Hide file tree
Showing 25 changed files with 73 additions and 58 deletions.
39 changes: 23 additions & 16 deletions build/build/faker.js
Original file line number Diff line number Diff line change
Expand Up @@ -2748,55 +2748,62 @@ function Faker (opts) {

self.definitions = {};

function bindAll(obj) {
Object.keys(obj).forEach(function(meth) {
if (typeof obj[meth] === 'function') {
obj[meth] = obj[meth].bind(obj);
}
});
return obj;
}

var Fake = require('./fake');
self.fake = new Fake(self).fake;

var Random = require('./random');
self.random = new Random(self, opts.seed);
// self.random = require('./random');
self.random = bindAll(new Random(self));

var Helpers = require('./helpers');
self.helpers = new Helpers(self);

var Name = require('./name');
self.name = new Name(self);
// self.name = require('./name');
self.name = bindAll(new Name(self));

var Address = require('./address');
self.address = new Address(self);
self.address = bindAll(new Address(self));

var Company = require('./company');
self.company = new Company(self);
self.company = bindAll(new Company(self));

var Finance = require('./finance');
self.finance = new Finance(self);
self.finance = bindAll(new Finance(self));

var Image = require('./image');
self.image = new Image(self);
self.image = bindAll(new Image(self));

var Lorem = require('./lorem');
self.lorem = new Lorem(self);
self.lorem = bindAll(new Lorem(self));

var Hacker = require('./hacker');
self.hacker = new Hacker(self);
self.hacker = bindAll(new Hacker(self));

var Internet = require('./internet');
self.internet = new Internet(self);
self.internet = bindAll(new Internet(self));

var Database = require('./database');
self.database = new Database(self);
self.database = bindAll(new Database(self));

var Phone = require('./phone_number');
self.phone = new Phone(self);
self.phone = bindAll(new Phone(self));

var _Date = require('./date');
self.date = new _Date(self);
self.date = bindAll(new _Date(self));

var Commerce = require('./commerce');
self.commerce = new Commerce(self);
self.commerce = bindAll(new Commerce(self));

var System = require('./system');
self.system = new System(self);
self.system = bindAll(new System(self));

var _definitions = {
"name": ["first_name", "last_name", "prefix", "suffix", "title", "male_first_name", "female_first_name", "male_middle_name", "female_middle_name", "male_last_name", "female_last_name"],
Expand Down
4 changes: 2 additions & 2 deletions build/build/faker.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion doc/faker.address.html
Original file line number Diff line number Diff line change
Expand Up @@ -1648,7 +1648,7 @@ <h4 class="modal-title">Search results</h4>
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a>

on 2017-02-20T18:57:41-05:00
on 2017-02-21T13:01:35-05:00

using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
</span>
Expand Down
2 changes: 1 addition & 1 deletion doc/faker.commerce.html
Original file line number Diff line number Diff line change
Expand Up @@ -878,7 +878,7 @@ <h4 class="modal-title">Search results</h4>
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a>

on 2017-02-20T18:57:41-05:00
on 2017-02-21T13:01:35-05:00

using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
</span>
Expand Down
2 changes: 1 addition & 1 deletion doc/faker.company.html
Original file line number Diff line number Diff line change
Expand Up @@ -1098,7 +1098,7 @@ <h4 class="modal-title">Search results</h4>
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a>

on 2017-02-20T18:57:41-05:00
on 2017-02-21T13:01:35-05:00

using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
</span>
Expand Down
2 changes: 1 addition & 1 deletion doc/faker.database.html
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ <h4 class="modal-title">Search results</h4>
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a>

on 2017-02-20T18:57:41-05:00
on 2017-02-21T13:01:35-05:00

using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
</span>
Expand Down
2 changes: 1 addition & 1 deletion doc/faker.date.html
Original file line number Diff line number Diff line change
Expand Up @@ -1030,7 +1030,7 @@ <h4 class="modal-title">Search results</h4>
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a>

on 2017-02-20T18:57:41-05:00
on 2017-02-21T13:01:35-05:00

using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
</span>
Expand Down
2 changes: 1 addition & 1 deletion doc/faker.finance.html
Original file line number Diff line number Diff line change
Expand Up @@ -1338,7 +1338,7 @@ <h4 class="modal-title">Search results</h4>
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a>

on 2017-02-20T18:57:41-05:00
on 2017-02-21T13:01:35-05:00

using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
</span>
Expand Down
2 changes: 1 addition & 1 deletion doc/faker.hacker.html
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,7 @@ <h4 class="modal-title">Search results</h4>
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a>

on 2017-02-20T18:57:41-05:00
on 2017-02-21T13:01:35-05:00

using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
</span>
Expand Down
2 changes: 1 addition & 1 deletion doc/faker.helpers.html
Original file line number Diff line number Diff line change
Expand Up @@ -1318,7 +1318,7 @@ <h4 class="modal-title">Search results</h4>
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a>

on 2017-02-20T18:57:41-05:00
on 2017-02-21T13:01:35-05:00

using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
</span>
Expand Down
2 changes: 1 addition & 1 deletion doc/faker.html
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ <h4 class="modal-title">Search results</h4>
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a>

on 2017-02-20T18:57:41-05:00
on 2017-02-21T13:01:35-05:00

using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
</span>
Expand Down
2 changes: 1 addition & 1 deletion doc/faker.image.html
Original file line number Diff line number Diff line change
Expand Up @@ -3084,7 +3084,7 @@ <h4 class="modal-title">Search results</h4>
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a>

on 2017-02-20T18:57:41-05:00
on 2017-02-21T13:01:35-05:00

using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
</span>
Expand Down
2 changes: 1 addition & 1 deletion doc/faker.internet.html
Original file line number Diff line number Diff line change
Expand Up @@ -1826,7 +1826,7 @@ <h4 class="modal-title">Search results</h4>
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a>

on 2017-02-20T18:57:41-05:00
on 2017-02-21T13:01:35-05:00

using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
</span>
Expand Down
2 changes: 1 addition & 1 deletion doc/faker.lorem.html
Original file line number Diff line number Diff line change
Expand Up @@ -1414,7 +1414,7 @@ <h4 class="modal-title">Search results</h4>
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a>

on 2017-02-20T18:57:41-05:00
on 2017-02-21T13:01:35-05:00

using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
</span>
Expand Down
2 changes: 1 addition & 1 deletion doc/faker.name.html
Original file line number Diff line number Diff line change
Expand Up @@ -1218,7 +1218,7 @@ <h4 class="modal-title">Search results</h4>
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a>

on 2017-02-20T18:57:41-05:00
on 2017-02-21T13:01:35-05:00

using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
</span>
Expand Down
2 changes: 1 addition & 1 deletion doc/faker.phone.html
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ <h4 class="modal-title">Search results</h4>
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a>

on 2017-02-20T18:57:41-05:00
on 2017-02-21T13:01:35-05:00

using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
</span>
Expand Down
2 changes: 1 addition & 1 deletion doc/faker.random.html
Original file line number Diff line number Diff line change
Expand Up @@ -1294,7 +1294,7 @@ <h4 class="modal-title">Search results</h4>
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a>

on 2017-02-20T18:57:41-05:00
on 2017-02-21T13:01:35-05:00

using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
</span>
Expand Down
2 changes: 1 addition & 1 deletion doc/faker.system.html
Original file line number Diff line number Diff line change
Expand Up @@ -1218,7 +1218,7 @@ <h4 class="modal-title">Search results</h4>
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a>

on 2017-02-20T18:57:41-05:00
on 2017-02-21T13:01:35-05:00

using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
</span>
Expand Down
4 changes: 2 additions & 2 deletions doc/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
<article><h1>faker.js - generate massive amounts of fake data in the browser and node.js</h1><p><img src="http://imgur.com/KiinQ.png" alt="Faker.js"></p>
<p><a href="https://travis-ci.org/Marak/faker.js"><img src="https://travis-ci.org/Marak/faker.js.svg?branch=master" alt="Build Status"></a></p>
<p><a href="http://badge.fury.io/js/faker"><img src="https://badge.fury.io/js/faker.svg" alt="npm version"></a></p>
<h2>Demo</h2><p><a href="http://marak.com/faker.js/">http://marak.com/faker.js/</a></p>
<h2>Demo</h2><p><a href="https://cdn.rawgit.com/Marak/faker.js/master/examples/browser/index.html">https://cdn.rawgit.com/Marak/faker.js/master/examples/browser/index.html</a></p>
<h2>Hosted API Microservice</h2><p><a href="http://faker.hook.io/">http://faker.hook.io</a></p>
<ul>
<li>Supports all Faker API Methods</li>
Expand Down Expand Up @@ -437,7 +437,7 @@ <h4 class="modal-title">Search results</h4>
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a>

on 2017-02-20T18:57:41-05:00
on 2017-02-21T13:01:35-05:00

using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
</span>
Expand Down
2 changes: 1 addition & 1 deletion doc/namespaces.list.html
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ <h4 class="modal-title">Search results</h4>
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a>

on 2017-02-20T18:57:41-05:00
on 2017-02-21T13:01:35-05:00

using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
</span>
Expand Down
2 changes: 1 addition & 1 deletion doc/quicksearch.html

Large diffs are not rendered by default.

39 changes: 23 additions & 16 deletions examples/browser/js/faker.js
Original file line number Diff line number Diff line change
Expand Up @@ -2748,55 +2748,62 @@ function Faker (opts) {

self.definitions = {};

function bindAll(obj) {
Object.keys(obj).forEach(function(meth) {
if (typeof obj[meth] === 'function') {
obj[meth] = obj[meth].bind(obj);
}
});
return obj;
}

var Fake = require('./fake');
self.fake = new Fake(self).fake;

var Random = require('./random');
self.random = new Random(self, opts.seed);
// self.random = require('./random');
self.random = bindAll(new Random(self));

var Helpers = require('./helpers');
self.helpers = new Helpers(self);

var Name = require('./name');
self.name = new Name(self);
// self.name = require('./name');
self.name = bindAll(new Name(self));

var Address = require('./address');
self.address = new Address(self);
self.address = bindAll(new Address(self));

var Company = require('./company');
self.company = new Company(self);
self.company = bindAll(new Company(self));

var Finance = require('./finance');
self.finance = new Finance(self);
self.finance = bindAll(new Finance(self));

var Image = require('./image');
self.image = new Image(self);
self.image = bindAll(new Image(self));

var Lorem = require('./lorem');
self.lorem = new Lorem(self);
self.lorem = bindAll(new Lorem(self));

var Hacker = require('./hacker');
self.hacker = new Hacker(self);
self.hacker = bindAll(new Hacker(self));

var Internet = require('./internet');
self.internet = new Internet(self);
self.internet = bindAll(new Internet(self));

var Database = require('./database');
self.database = new Database(self);
self.database = bindAll(new Database(self));

var Phone = require('./phone_number');
self.phone = new Phone(self);
self.phone = bindAll(new Phone(self));

var _Date = require('./date');
self.date = new _Date(self);
self.date = bindAll(new _Date(self));

var Commerce = require('./commerce');
self.commerce = new Commerce(self);
self.commerce = bindAll(new Commerce(self));

var System = require('./system');
self.system = new System(self);
self.system = bindAll(new System(self));

var _definitions = {
"name": ["first_name", "last_name", "prefix", "suffix", "title", "male_first_name", "female_first_name", "male_middle_name", "female_middle_name", "male_last_name", "female_last_name"],
Expand Down
4 changes: 2 additions & 2 deletions examples/browser/js/faker.min.js

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion examples/node/generators.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ var faker = require('../../index');

faker.locale = "en";

console.log(faker.fake('{{random.uuid}}, {{name.firstName}} {{name.suffix}}'));


console.log(faker.fake('{{name.lastName}}, {{name.firstName}} {{name.suffix}}'));
return;


console.log(faker.fake('{{finance.currencyName}} - {{finance.amount}}'));
Expand Down
2 changes: 1 addition & 1 deletion locale/es_MX.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ var Faker = require('../lib');
var faker = new Faker({ locale: 'es_MX', localeFallback: 'en' });
faker.locales['es_MX'] = require('../lib/locales/es_MX');
faker.locales['en'] = require('../lib/locales/en');
module['exports'] = faker;
module['exports'] = faker;

0 comments on commit cf877ea

Please sign in to comment.