From ae7b3cadb243d7f0055898776871b34cac1a370b Mon Sep 17 00:00:00 2001 From: ST-DDT Date: Wed, 23 Nov 2022 18:22:35 +0100 Subject: chore(date): adjust to our standard implementation (#1589) --- src/modules/date/index.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src/modules') 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; -- cgit v1.2.3