aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorST-DDT <[email protected]>2024-12-09 23:43:13 +0100
committerGitHub <[email protected]>2024-12-09 23:43:13 +0100
commit8b2976f3479db445a2a7b66606110009495478f4 (patch)
tree57c8b84aede1ead83e9b99d8611bfae39d17826a /src
parentea7900ded55d05c683d52c7a2d7e4c009ae83695 (diff)
downloadfaker-8b2976f3479db445a2a7b66606110009495478f4.tar.xz
faker-8b2976f3479db445a2a7b66606110009495478f4.zip
chore: align coding style of lorem module (#3313)
Diffstat (limited to 'src')
-rw-r--r--src/modules/lorem/index.ts7
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,
})
);