mirror of
https://github.com/stack-auth/stack.git
synced 2026-06-21 21:09:49 +08:00
13 lines
309 B
TypeScript
13 lines
309 B
TypeScript
import { Interval } from "@stackframe/stack-shared/dist/utils/dates";
|
|
|
|
export function readableInterval(interval: Interval | "never"): string {
|
|
if (interval === "never") {
|
|
return "Never";
|
|
}
|
|
const [amount, unit] = interval;
|
|
if (amount === 1) {
|
|
return unit;
|
|
}
|
|
return `${amount} ${unit}s`;
|
|
}
|