aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/system.ts5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/system.ts b/src/system.ts
index 23e65d5e..564069f3 100644
--- a/src/system.ts
+++ b/src/system.ts
@@ -57,13 +57,12 @@ export class System {
/**
* Returns a random file name with a given extension or a commonly used extension.
*
- * @param ext Extension
-
+ * @param ext Extension. Empty string is considered to be not set.
* @example
* faker.system.commonFileName() // 'dollar.jpg'
* faker.system.commonFileName('txt') // 'global_borders_wyoming.txt'
*/
- commonFileName(ext): string {
+ commonFileName(ext?: string): string {
let str = this.faker.random.words();
str = str.toLowerCase().replace(/\W/g, '_');
str += '.' + (ext || this.faker.system.commonFileExt());