diff options
| author | Piotr Kuczynski <[email protected]> | 2022-01-28 11:09:38 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2022-01-28 11:09:38 +0100 |
| commit | bba47418fe79b4023cb5e435bcbe2bd6e0ea4018 (patch) | |
| tree | e50d25f0450e3ba35a730df85ee8270f7b2db25d | |
| parent | 32b483920450a5c1a084e83723f1c433db8ff34f (diff) | |
| download | faker-bba47418fe79b4023cb5e435bcbe2bd6e0ea4018.tar.xz faker-bba47418fe79b4023cb5e435bcbe2bd6e0ea4018.zip | |
chore: add missing type on the system.commonFileName method (#299)
| -rw-r--r-- | src/system.ts | 5 |
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()); |
