Skip to content

Commit

Permalink
Specify length of toArrary return value
Browse files Browse the repository at this point in the history
toArray will always return an array with seven numbers. This change is necessary to be able to do `new Date(...m.toArray())`. As just `number[]`, it complains with `Expected 0-7 arguments, but got 0 or more.`.
  • Loading branch information
mongoose700 committed Oct 28, 2020
1 parent 0dcaaa6 commit 352dd45
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion moment.d.ts
Expand Up @@ -585,7 +585,7 @@ declare namespace moment {

diff(b: MomentInput, unitOfTime?: unitOfTime.Diff, precise?: boolean): number;

toArray(): number[];
toArray(): [number, number, number, number, number, number, number];
toDate(): Date;
toISOString(keepOffset?: boolean): string;
inspect(): string;
Expand Down

0 comments on commit 352dd45

Please sign in to comment.