Skip to content

Commit

Permalink
fix: dont allow values less then 0
Browse files Browse the repository at this point in the history
  • Loading branch information
Shinigami92 committed Nov 9, 2022
1 parent a255259 commit 552560d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/modules/date/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export class DateModule {
} = {},
legacyRefDate?: string | Date | number
): Date {
if (typeof options === 'number') {
if (typeof options !== 'object') {
deprecated({
deprecated: 'faker.date.past(years, refDate)',
proposed: 'faker.date.past({ years, refDate })',
Expand Down Expand Up @@ -197,7 +197,7 @@ export class DateModule {
} = {},
legacyRefDate?: string | Date | number
): Date {
if (typeof options === 'number') {
if (typeof options !== 'object') {
deprecated({
deprecated: 'faker.date.future(years, refDate)',
proposed: 'faker.date.future({ years, refDate })',
Expand Down

0 comments on commit 552560d

Please sign in to comment.