Skip to content

Commit

Permalink
null !=
Browse files Browse the repository at this point in the history
  • Loading branch information
pkuczynski committed Mar 23, 2022
1 parent dcbe48e commit 360815f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/date.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ import type { Faker } from '.';
import type { DateEntryDefinition } from './definitions';

const toDate = (date?: string | Date): Date => {
if (date !== undefined) {
if (date != null) {
return new Date(date instanceof Date ? date : Date.parse(date));
}

return new Date();
};

const toMilliseconds = (date?: string | Date): number => {
if (date !== undefined) {
if (date != null) {
return date instanceof Date ? date.getTime() : Date.parse(date);
}

Expand Down

0 comments on commit 360815f

Please sign in to comment.