diff options
| author | ashmothership <[email protected]> | 2016-03-20 01:43:26 +0000 |
|---|---|---|
| committer | ashmothership <[email protected]> | 2016-03-20 01:43:26 +0000 |
| commit | b41d9a393703d84ff7e0588036ba73cc49f06232 (patch) | |
| tree | 3babf5b85064296e60ee0d0332c166e2951e51aa /lib | |
| parent | 1238c8b65e15972f9746863b8b3b5a6161b34770 (diff) | |
| parent | eef113c2cec2a83116e31d36473ef2b393058a1f (diff) | |
| download | faker-b41d9a393703d84ff7e0588036ba73cc49f06232.tar.xz faker-b41d9a393703d84ff7e0588036ba73cc49f06232.zip | |
Merge remote-tracking branch 'Marak/master'
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/fake.js | 7 | ||||
| -rw-r--r-- | lib/finance.js | 1 | ||||
| -rw-r--r-- | lib/random.js | 9 |
3 files changed, 16 insertions, 1 deletions
diff --git a/lib/fake.js b/lib/fake.js index 977ba292..7e24c854 100644 --- a/lib/fake.js +++ b/lib/fake.js @@ -86,7 +86,12 @@ function Fake (faker) { params = parameters; } - var result = fn.call(this, params); + var result; + if (typeof params === "string" && params.length === 0) { + result = fn.call(this); + } else { + result = fn.call(this, params); + } // replace the found tag with the returned fake value res = str.replace('{{' + token + '}}', result); diff --git a/lib/finance.js b/lib/finance.js index 9b478573..a7c7b873 100644 --- a/lib/finance.js +++ b/lib/finance.js @@ -134,6 +134,7 @@ var Finance = function (faker) { } return symbol; } + } module['exports'] = Finance; diff --git a/lib/random.js b/lib/random.js index b152ddbd..d3cbf3ea 100644 --- a/lib/random.js +++ b/lib/random.js @@ -189,6 +189,15 @@ function Random (faker, seed) { return faker.random.arrayElement(Object.keys(faker.locales)); }; + /** + * alphaNumeric + * + * @method faker.random.alphaNumeric + */ + this.alphaNumeric = function alphaNumeric() { + return faker.random.arrayElement(["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"]); + } + return this; } |
