diff options
| author | Marak <[email protected]> | 2016-03-19 18:47:15 -0400 |
|---|---|---|
| committer | Marak <[email protected]> | 2016-03-19 18:47:15 -0400 |
| commit | ce99419cbacea9a200035f5c1f202c43f6507225 (patch) | |
| tree | 114c029f34c6e0ebf6d12424d5728c2060109bdc /lib | |
| parent | 89b00e29c6dd8765464fe4fe8abdc179c01cbab6 (diff) | |
| download | faker-ce99419cbacea9a200035f5c1f202c43f6507225.tar.xz faker-ce99419cbacea9a200035f5c1f202c43f6507225.zip | |
[fix] Don't pass empty strings to Faker.fake
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/fake.js | 7 |
1 files changed, 6 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); |
