File tree Expand file tree Collapse file tree 1 file changed +0
-24
lines changed
Expand file tree Collapse file tree 1 file changed +0
-24
lines changed Original file line number Diff line number Diff line change 11import * 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-
273export function assertInDir (
284 filePath : string ,
295 dir : string ,
You can’t perform that action at this time.
0 commit comments