diff options
| author | Shinigami <[email protected]> | 2023-02-01 14:04:18 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-02-01 14:04:18 +0100 |
| commit | 5b705d4b047640e91b690566d6e0fdbae17bb842 (patch) | |
| tree | a179a77cca1b72e2c730607def2786a5531b531f /src/modules/string | |
| parent | be77179faf097383763eaa6414cf7b6a1a8b131a (diff) | |
| download | faker-5b705d4b047640e91b690566d6e0fdbae17bb842.tar.xz faker-5b705d4b047640e91b690566d6e0fdbae17bb842.zip | |
infra: configure lint rule array-type (#1793)
Diffstat (limited to 'src/modules/string')
| -rw-r--r-- | src/modules/string/index.ts | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/modules/string/index.ts b/src/modules/string/index.ts index 8f62788a..6240184c 100644 --- a/src/modules/string/index.ts +++ b/src/modules/string/index.ts @@ -4,9 +4,13 @@ import type { LiteralUnion } from '../../utils/types'; export type Casing = 'upper' | 'lower' | 'mixed'; -const UPPER_CHARS: readonly string[] = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'.split(''); -const LOWER_CHARS: readonly string[] = 'abcdefghijklmnopqrstuvwxyz'.split(''); -const DIGIT_CHARS: readonly string[] = '0123456789'.split(''); +const UPPER_CHARS: ReadonlyArray<string> = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'.split( + '' +); +const LOWER_CHARS: ReadonlyArray<string> = 'abcdefghijklmnopqrstuvwxyz'.split( + '' +); +const DIGIT_CHARS: ReadonlyArray<string> = '0123456789'.split(''); export type LowerAlphaChar = | 'a' @@ -200,7 +204,7 @@ export class StringModule { * * @default [] */ - exclude?: readonly LiteralUnion<AlphaChar>[] | string; + exclude?: ReadonlyArray<LiteralUnion<AlphaChar>> | string; } = {} ): string { if (typeof options === 'number') { @@ -290,7 +294,7 @@ export class StringModule { * * @default [] */ - exclude?: readonly LiteralUnion<AlphaNumericChar>[] | string; + exclude?: ReadonlyArray<LiteralUnion<AlphaNumericChar>> | string; } = {} ): string { if (typeof options === 'number') { @@ -567,7 +571,7 @@ export class StringModule { * * @default [] */ - exclude?: readonly LiteralUnion<NumericChar>[] | string; + exclude?: ReadonlyArray<LiteralUnion<NumericChar>> | string; } = {} ): string { if (typeof options === 'number') { |
