MCPcopy
hub / github.com/faker-js/faker / commonFileName

Method commonFileName

src/modules/system/index.ts:103–107  ·  view source on GitHub ↗

* Returns a random file name with a given extension or a commonly used extension. * * @param extension The file extension to use. Empty string is considered to be not set. * * @example * faker.system.commonFileName() // 'dollar.jpg' * faker.system.commonFileName('txt') // 'global_b

(extension?: string)

Source from the content-addressed store, hash-verified

101 * @since 3.1.0
102 */
103 commonFileName(extension?: string): string {
104 const fileName = this.fileName({ extensionCount: 0 });
105
106 return `${fileName}.${extension || this.commonFileExt()}`;
107 }
108
109 /**
110 * Returns a mime-type.

Callers 1

system.spec.tsFile · 0.80

Calls 2

fileNameMethod · 0.95
commonFileExtMethod · 0.95

Tested by

no test coverage detected