From c9a540f5ce955fa66c29f43be9f334e7f6366ac7 Mon Sep 17 00:00:00 2001 From: Shinigami Date: Fri, 28 Jan 2022 08:28:52 +0100 Subject: chore: replace var (#315) --- src/datatype.ts | 2 +- src/helpers.ts | 4 ++-- src/name.ts | 18 +++++++++--------- src/word.ts | 12 ++++++------ 4 files changed, 18 insertions(+), 18 deletions(-) (limited to 'src') diff --git a/src/datatype.ts b/src/datatype.ts index e5dac1f9..7cf28012 100644 --- a/src/datatype.ts +++ b/src/datatype.ts @@ -139,7 +139,7 @@ export class Datatype { let returnString = ''; - for (var i = 0; i < length; i++) { + for (let i = 0; i < length; i++) { returnString += String.fromCharCode( this.faker.datatype.number(charCodeOption) ); diff --git a/src/helpers.ts b/src/helpers.ts index 2c83a96e..5b95e25f 100644 --- a/src/helpers.ts +++ b/src/helpers.ts @@ -381,8 +381,8 @@ export class Helpers { * @method faker.helpers.contextualCard */ contextualCard() { - var name = this.faker.name.firstName(), - userName = this.faker.internet.userName(name); + const name = this.faker.name.firstName(); + const userName = this.faker.internet.userName(name); return { name: name, username: userName, diff --git a/src/name.ts b/src/name.ts index bbb71c8c..e19dab2c 100644 --- a/src/name.ts +++ b/src/name.ts @@ -247,15 +247,15 @@ export class Name { * @memberof faker.name */ title(): string { - var descriptor = this.faker.random.arrayElement( - this.faker.definitions.name.title.descriptor - ), - level = this.faker.random.arrayElement( - this.faker.definitions.name.title.level - ), - job = this.faker.random.arrayElement( - this.faker.definitions.name.title.job - ); + const descriptor = this.faker.random.arrayElement( + this.faker.definitions.name.title.descriptor + ); + const level = this.faker.random.arrayElement( + this.faker.definitions.name.title.level + ); + const job = this.faker.random.arrayElement( + this.faker.definitions.name.title.job + ); return descriptor + ' ' + level + ' ' + job; } diff --git a/src/word.ts b/src/word.ts index a5111dca..5bd9cefa 100644 --- a/src/word.ts +++ b/src/word.ts @@ -18,7 +18,7 @@ export class Word { * @param optional length of word to return */ adjective(length?: number): string { - var wordList = this.faker.definitions.word.adjective; + let wordList = this.faker.definitions.word.adjective; if (length) { wordList = this.faker.definitions.word.adjective.filter( @@ -64,7 +64,7 @@ export class Word { * @param optional length of word to return */ conjunction(length?: number): string { - var wordList = this.faker.definitions.word.conjunction; + let wordList = this.faker.definitions.word.conjunction; if (length) { wordList = this.faker.definitions.word.conjunction.filter( @@ -87,7 +87,7 @@ export class Word { * @param optional length of word to return */ interjection(length?: number): string { - var wordList = this.faker.definitions.word.interjection; + let wordList = this.faker.definitions.word.interjection; if (length) { wordList = this.faker.definitions.word.interjection.filter( @@ -110,7 +110,7 @@ export class Word { * @param optional length of word to return */ noun(length?: number): string { - var wordList = this.faker.definitions.word.noun; + let wordList = this.faker.definitions.word.noun; if (length) { wordList = this.faker.definitions.word.noun.filter( @@ -133,7 +133,7 @@ export class Word { * @param optional length of word to return */ preposition(length?: number): string { - var wordList = this.faker.definitions.word.preposition; + let wordList = this.faker.definitions.word.preposition; if (length) { wordList = this.faker.definitions.word.preposition.filter( @@ -156,7 +156,7 @@ export class Word { * @param optional length of word to return */ verb(length?: number): string { - var wordList = this.faker.definitions.word.verb; + let wordList = this.faker.definitions.word.verb; if (length) { wordList = this.faker.definitions.word.verb.filter( -- cgit v1.2.3