diff options
| author | ST-DDT <[email protected]> | 2023-04-28 15:17:34 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-04-28 13:17:34 +0000 |
| commit | 971f36371bf924b334cb7766fd87afa7b484119a (patch) | |
| tree | 1ad3b8ae43548e0a5ec2e6017e928ce39cfeda46 /src/modules/helpers | |
| parent | 8395e6991cd00951d9e25ae489cb191c4c3957b6 (diff) | |
| download | faker-971f36371bf924b334cb7766fd87afa7b484119a.tar.xz faker-971f36371bf924b334cb7766fd87afa7b484119a.zip | |
fix(types): locale proxy (#2099)
Diffstat (limited to 'src/modules/helpers')
| -rw-r--r-- | src/modules/helpers/index.ts | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/modules/helpers/index.ts b/src/modules/helpers/index.ts index 3b94586d..048614cf 100644 --- a/src/modules/helpers/index.ts +++ b/src/modules/helpers/index.ts @@ -1086,7 +1086,7 @@ export class HelpersModule { * * @since 8.0.0 */ - fake(patterns: string[]): string; + fake(patterns: ReadonlyArray<string>): string; /** * Generator for combining faker methods based on a static string input or an array of static string inputs. * @@ -1135,11 +1135,10 @@ export class HelpersModule { * * @since 7.4.0 */ - fake(pattern: string | string[]): string; - fake(pattern: string | string[]): string { - if (Array.isArray(pattern)) { - pattern = this.arrayElement(pattern); - } + fake(pattern: string | ReadonlyArray<string>): string; + fake(pattern: string | ReadonlyArray<string>): string { + pattern = + typeof pattern === 'string' ? pattern : this.arrayElement(pattern); // find first matching {{ and }} const start = pattern.search(/{{[a-z]/); |
