diff options
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, }) ); |
