From bba47418fe79b4023cb5e435bcbe2bd6e0ea4018 Mon Sep 17 00:00:00 2001 From: Piotr Kuczynski Date: Fri, 28 Jan 2022 11:09:38 +0100 Subject: chore: add missing type on the system.commonFileName method (#299) --- src/system.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src') 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()); -- cgit v1.2.3