Skip to content

Commit 5876ca7

Browse files
authored
chore: remove prettyTime() (#2859)
This isn't used anywhere.
1 parent b8f1be7 commit 5876ca7

File tree

1 file changed

+0
-24
lines changed

1 file changed

+0
-24
lines changed

src/utils.ts

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,5 @@
11
import * as path from "@std/path";
22

3-
const PERIODS = {
4-
year: 365 * 24 * 60 * 60 * 1000,
5-
month: 30 * 24 * 60 * 60 * 1000,
6-
week: 7 * 24 * 60 * 60 * 1000,
7-
day: 24 * 60 * 60 * 1000,
8-
hour: 60 * 60 * 1000,
9-
minute: 60 * 1000,
10-
seconds: 1000,
11-
};
12-
13-
export function prettyTime(diff: number) {
14-
if (diff > PERIODS.day) {
15-
return Math.floor(diff / PERIODS.day) + "d";
16-
} else if (diff > PERIODS.hour) {
17-
return Math.floor(diff / PERIODS.hour) + "h";
18-
} else if (diff > PERIODS.minute) {
19-
return Math.floor(diff / PERIODS.minute) + "m";
20-
} else if (diff > PERIODS.seconds) {
21-
return Math.floor(diff / PERIODS.seconds) + "s";
22-
}
23-
24-
return diff + "ms";
25-
}
26-
273
export function assertInDir(
284
filePath: string,
295
dir: string,

0 commit comments

Comments
 (0)