mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 04:01:58 +00:00
chore: Simplify the state into one
This commit is contained in:
6
container-runtime/src/Models/Duration.ts
Normal file
6
container-runtime/src/Models/Duration.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
export type TimeUnit = "d" | "h" | "s" | "ms"
|
||||
export type Duration = `${number}${TimeUnit}`
|
||||
|
||||
export function duration(timeValue: number, timeUnit: TimeUnit = "s") {
|
||||
return `${timeValue}${timeUnit}` as Duration
|
||||
}
|
||||
Reference in New Issue
Block a user