aboutsummaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorST-DDT <[email protected]>2022-11-23 18:22:35 +0100
committerGitHub <[email protected]>2022-11-23 18:22:35 +0100
commitae7b3cadb243d7f0055898776871b34cac1a370b (patch)
treefd1759d9ebfdf184f1d80969ddf540fe7ba0850c /src/modules
parent6e1009ae0ab6a185eaf808e2dd4d8dcab65c79b6 (diff)
downloadfaker-ae7b3cadb243d7f0055898776871b34cac1a370b.tar.xz
faker-ae7b3cadb243d7f0055898776871b34cac1a370b.zip
chore(date): adjust to our standard implementation (#1589)
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/date/index.ts10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/modules/date/index.ts b/src/modules/date/index.ts
index ea9d15d7..339ab0ab 100644
--- a/src/modules/date/index.ts
+++ b/src/modules/date/index.ts
@@ -230,9 +230,8 @@ export class DateModule {
*
* @since 3.0.1
*/
- month(options?: { abbr?: boolean; context?: boolean }): string {
- const abbr = options?.abbr ?? false;
- const context = options?.context ?? false;
+ month(options: { abbr?: boolean; context?: boolean } = {}): string {
+ const { abbr = false, context = false } = options;
const source = this.faker.definitions.date.month;
let type: keyof DateEntryDefinition;
@@ -266,9 +265,8 @@ export class DateModule {
*
* @since 3.0.1
*/
- weekday(options?: { abbr?: boolean; context?: boolean }): string {
- const abbr = options?.abbr ?? false;
- const context = options?.context ?? false;
+ weekday(options: { abbr?: boolean; context?: boolean } = {}): string {
+ const { abbr = false, context = false } = options;
const source = this.faker.definitions.date.weekday;
let type: keyof DateEntryDefinition;