aboutsummaryrefslogtreecommitdiff
path: root/src/system.ts
diff options
context:
space:
mode:
authorEric Cheng <[email protected]>2022-01-29 15:48:16 -0500
committerGitHub <[email protected]>2022-01-29 21:48:16 +0100
commitb5482df6a5083555d6ac0d87de89b0736615c727 (patch)
tree3f7c00304b9df3326631f8cdc4211776b7f57cb1 /src/system.ts
parent6820a2908e771d5563f55355c819d86b4209855b (diff)
downloadfaker-b5482df6a5083555d6ac0d87de89b0736615c727.tar.xz
faker-b5482df6a5083555d6ac0d87de89b0736615c727.zip
chore: add more type annotations (#358)
Diffstat (limited to 'src/system.ts')
-rw-r--r--src/system.ts12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/system.ts b/src/system.ts
index 564069f3..063941f0 100644
--- a/src/system.ts
+++ b/src/system.ts
@@ -47,7 +47,7 @@ export class System {
* @example
* faker.system.fileName() // 'self_enabling_accountability_toys.kpt'
*/
- fileName() {
+ fileName(): string {
let str = this.faker.random.words();
str =
str.toLowerCase().replace(/\W/g, '_') + '.' + this.faker.system.fileExt();
@@ -75,7 +75,7 @@ export class System {
* @example
* faker.system.mimeType() // 'video/vnd.vivo'
*/
- mimeType() {
+ mimeType(): string {
const typeSet = new Set<string>();
const extensionSet = new Set();
const mimeTypes = this.faker.definitions.system.mimeTypes;
@@ -105,7 +105,7 @@ export class System {
* @example
* faker.system.commonFileType() // 'audio'
*/
- commonFileType() {
+ commonFileType(): string {
return this.faker.random.arrayElement(commonFileTypes);
}
@@ -115,7 +115,7 @@ export class System {
* @example
* faker.system.commonFileExt() // 'gif'
*/
- commonFileExt() {
+ commonFileExt(): string {
return this.faker.system.fileExt(
this.faker.random.arrayElement(commonMimeTypes)
);
@@ -127,7 +127,7 @@ export class System {
* @example
* faker.system.fileType() // 'message'
*/
- fileType() {
+ fileType(): string {
const typeSet = new Set<string>();
const extensionSet = new Set();
const mimeTypes = this.faker.definitions.system.mimeTypes;
@@ -205,7 +205,7 @@ export class System {
* @example
* faker.system.filePath() // '/usr/local/src/money.rmp.dotx'
*/
- filePath() {
+ filePath(): string {
return this.faker.fake(
'{{system.directoryPath}}/{{system.fileName}}.{{system.fileExt}}'
);