From 8b2976f3479db445a2a7b66606110009495478f4 Mon Sep 17 00:00:00 2001 From: ST-DDT Date: Mon, 9 Dec 2024 23:43:13 +0100 Subject: chore: align coding style of lorem module (#3313) --- src/modules/lorem/index.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src') 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, }) ); -- cgit v1.2.3