diff options
| author | ST-DDT <[email protected]> | 2024-12-09 23:43:13 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-12-09 23:43:13 +0100 |
| commit | 8b2976f3479db445a2a7b66606110009495478f4 (patch) | |
| tree | 57c8b84aede1ead83e9b99d8611bfae39d17826a /src/modules | |
| parent | ea7900ded55d05c683d52c7a2d7e4c009ae83695 (diff) | |
| download | faker-8b2976f3479db445a2a7b66606110009495478f4.tar.xz faker-8b2976f3479db445a2a7b66606110009495478f4.zip | |
chore: align coding style of lorem module (#3313)
Diffstat (limited to 'src/modules')
| -rw-r--r-- | src/modules/lorem/index.ts | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/modules/lorem/index.ts b/src/modules/lorem/index.ts index 785b5a96..880fb1a6 100644 --- a/src/modules/lorem/index.ts +++ b/src/modules/lorem/index.ts @@ -75,10 +75,13 @@ export class LoremModule extends ModuleBase { strategy?: 'fail' | 'closest' | 'shortest' | 'longest' | 'any-length'; } = {} ): string { - const opts = typeof options === 'number' ? { length: options } : options; + if (typeof options === 'number') { + options = { length: options }; + } + return this.faker.helpers.arrayElement( filterWordListByLength({ - ...opts, + ...options, wordList: this.faker.definitions.lorem.word, }) ); |
