Skip to content

Commit c4877fe

Browse files
pkuczynskidemipel8
authored andcommitted
chore: add missing type on the system.commonFileName method (faker-js#299)
1 parent d864094 commit c4877fe

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/system.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,12 @@ export class System {
5757
/**
5858
* Returns a random file name with a given extension or a commonly used extension.
5959
*
60-
* @param ext Extension
61-
60+
* @param ext Extension. Empty string is considered to be not set.
6261
* @example
6362
* faker.system.commonFileName() // 'dollar.jpg'
6463
* faker.system.commonFileName('txt') // 'global_borders_wyoming.txt'
6564
*/
66-
commonFileName(ext): string {
65+
commonFileName(ext?: string): string {
6766
let str = this.faker.random.words();
6867
str = str.toLowerCase().replace(/\W/g, '_');
6968
str += '.' + (ext || this.faker.system.commonFileExt());

0 commit comments

Comments
 (0)