Skip to content

Commit

Permalink
Add minute support for parseDuration
Browse files Browse the repository at this point in the history
  • Loading branch information
RezaKargar committed Mar 27, 2024
1 parent 1a03a62 commit 1b18e45
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,8 @@ export function parseDuration(d: Duration) {
return +d.slice(0, -1) * 1000
} else if (/\d+ms/.test(d)) {
return +d.slice(0, -2)
} else if (/\d+m/.test(d)) {
return +d.slice(0, -1) * 1000 * 60
}
throw new Error(`Unknown duration: "${d}".`)
}
Expand Down

0 comments on commit 1b18e45

Please sign in to comment.