diff options
Diffstat (limited to 'src/modules')
| -rw-r--r-- | src/modules/finance/index.ts | 2 | ||||
| -rw-r--r-- | src/modules/image/index.ts | 7 | ||||
| -rw-r--r-- | src/modules/word/filter-word-list-by-length.ts | 4 |
3 files changed, 6 insertions, 7 deletions
diff --git a/src/modules/finance/index.ts b/src/modules/finance/index.ts index 2664cdfc..b381e16c 100644 --- a/src/modules/finance/index.ts +++ b/src/modules/finance/index.ts @@ -815,7 +815,7 @@ export class FinanceModule { const normalizedIssuer = issuer.toLowerCase(); if (normalizedIssuer in localeFormat) { format = this.faker.helpers.arrayElement(localeFormat[normalizedIssuer]); - } else if (/#/.test(issuer)) { + } else if (issuer.includes('#')) { // The user chose an optional scheme format = issuer; } else { diff --git a/src/modules/image/index.ts b/src/modules/image/index.ts index a93f181e..b1c9c692 100644 --- a/src/modules/image/index.ts +++ b/src/modules/image/index.ts @@ -232,17 +232,16 @@ export class ImageModule { length: { min: 5, max: 10 }, })}/${width}/${height}`; - const hasValidGrayscale = grayscale === true; const hasValidBlur = typeof blur === 'number' && blur >= 1 && blur <= 10; - if (hasValidGrayscale || hasValidBlur) { + if (grayscale || hasValidBlur) { url += '?'; - if (hasValidGrayscale) { + if (grayscale) { url += `grayscale`; } - if (hasValidGrayscale && hasValidBlur) { + if (grayscale && hasValidBlur) { url += '&'; } diff --git a/src/modules/word/filter-word-list-by-length.ts b/src/modules/word/filter-word-list-by-length.ts index 106e9858..60c6fae9 100644 --- a/src/modules/word/filter-word-list-by-length.ts +++ b/src/modules/word/filter-word-list-by-length.ts @@ -13,12 +13,12 @@ const STRATEGIES = { wordList: ReadonlyArray<string>, length: { min: number; max: number } ): string[] => { - const wordsByLength = wordList.reduce( + const wordsByLength = wordList.reduce<Record<number, string[]>>( (data, word) => { (data[word.length] = data[word.length] ?? []).push(word); return data; }, - {} as Record<number, string[]> + {} ); const lengths = Object.keys(wordsByLength).map(Number); |
