Skip to content

Commit ce99419

Browse files
committed
[fix] Don't pass empty strings to Faker.fake
1 parent 89b00e2 commit ce99419

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/fake.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,12 @@ function Fake (faker) {
8686
params = parameters;
8787
}
8888

89-
var result = fn.call(this, params);
89+
var result;
90+
if (typeof params === "string" && params.length === 0) {
91+
result = fn.call(this);
92+
} else {
93+
result = fn.call(this, params);
94+
}
9095

9196
// replace the found tag with the returned fake value
9297
res = str.replace('{{' + token + '}}', result);

0 commit comments

Comments
 (0)