We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d864094 commit c4877feCopy full SHA for c4877fe
src/system.ts
@@ -57,13 +57,12 @@ export class System {
57
/**
58
* Returns a random file name with a given extension or a commonly used extension.
59
*
60
- * @param ext Extension
61
-
+ * @param ext Extension. Empty string is considered to be not set.
62
* @example
63
* faker.system.commonFileName() // 'dollar.jpg'
64
* faker.system.commonFileName('txt') // 'global_borders_wyoming.txt'
65
*/
66
- commonFileName(ext): string {
+ commonFileName(ext?: string): string {
67
let str = this.faker.random.words();
68
str = str.toLowerCase().replace(/\W/g, '_');
69
str += '.' + (ext || this.faker.system.commonFileExt());
0 commit comments