aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMarak <[email protected]>2016-03-19 18:47:15 -0400
committerMarak <[email protected]>2016-03-19 18:47:15 -0400
commitce99419cbacea9a200035f5c1f202c43f6507225 (patch)
tree114c029f34c6e0ebf6d12424d5728c2060109bdc /lib
parent89b00e29c6dd8765464fe4fe8abdc179c01cbab6 (diff)
downloadfaker-ce99419cbacea9a200035f5c1f202c43f6507225.tar.xz
faker-ce99419cbacea9a200035f5c1f202c43f6507225.zip
[fix] Don't pass empty strings to Faker.fake
Diffstat (limited to 'lib')
-rw-r--r--lib/fake.js7
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);