Skip to content

Commit

Permalink
fix(types): fixed datetime types for optional argument (faker-js#192)
Browse files Browse the repository at this point in the history
Co-authored-by: Shinigami <chrissi92@hotmail.de>
  • Loading branch information
jared-fraser and Shinigami92 committed Jan 18, 2022
1 parent a5d853b commit 314afb0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/datatype.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,9 @@ export class Datatype {
* @method faker.datatype.datetime
* @param options pass min OR max as number of milliseconds since 1. Jan 1970 UTC
*/
datetime(options): Date {
datetime(
options?: number | { min?: number; max?: number; precision?: number }
): Date {
if (typeof options === 'number') {
options = {
max: options,
Expand Down

0 comments on commit 314afb0

Please sign in to comment.