Skip to content

Commit

Permalink
feat(zero): add zero constant
Browse files Browse the repository at this point in the history
  • Loading branch information
djcsdy committed Sep 21, 2019
1 parent 6edb1ab commit 61a8258
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ export function normalize(duration: DurationLike): Duration {
return fromSeconds(toSeconds(duration));
}

export const zero: Duration = {hours: 0, minutes: 0, seconds: 0};

export function toSeconds(duration: DurationLike): number {
const hours = duration.hours == null ? 0 : duration.hours;
const minutes = duration.minutes == null ? 0 : duration.minutes;
Expand Down

0 comments on commit 61a8258

Please sign in to comment.