aboutsummaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/helpers/index.ts12
1 files changed, 2 insertions, 10 deletions
diff --git a/src/modules/helpers/index.ts b/src/modules/helpers/index.ts
index cb4f7680..2ccc311e 100644
--- a/src/modules/helpers/index.ts
+++ b/src/modules/helpers/index.ts
@@ -526,7 +526,7 @@ export class HelpersModule {
*
* It is also NOT possible to use any non-faker methods or plain javascript in such patterns.
*
- * @param pattern The pattern string that will get interpolated. Must not be empty.
+ * @param pattern The pattern string that will get interpolated.
*
* @see faker.helpers.mustache() to use custom functions for resolution.
*
@@ -621,7 +621,7 @@ export class HelpersModule {
*
* It is also NOT possible to use any non-faker methods or plain javascript in such patterns.
*
- * @param pattern The pattern string that will get interpolated. Must not be empty. If an array is passed, a random element will be picked and interpolated.
+ * @param pattern The pattern string that will get interpolated. If an array is passed, a random element will be picked and interpolated.
*
* @see faker.helpers.mustache() to use custom functions for resolution.
*
@@ -645,10 +645,6 @@ export class HelpersModule {
throw new FakerError('Array of pattern strings cannot be empty.');
}
}
- // if incoming str parameter is not provided, return error message
- if (pattern.length === 0) {
- throw new FakerError('Pattern string cannot be empty.');
- }
// find first matching {{ and }}
const start = pattern.search(/{{[a-z]/);
@@ -721,10 +717,6 @@ export class HelpersModule {
const res =
pattern.substring(0, start) + result + pattern.substring(end + 2);
- if (res === '') {
- return '';
- }
-
// return the response recursively until we are done finding all tags
return this.fake(res);
}