GHHG10/CodeServer / opencode /packages /app /src /components /session /session-context-format.ts
GHHG10's picture
download
raw
652 Bytes
import { DateTime } from "luxon"
export function createSessionContextFormatter(locale: string) {
return {
number(value: number | null | undefined) {
if (value === undefined) return "—"
if (value === null) return "—"
return value.toLocaleString(locale)
},
percent(value: number | null | undefined) {
if (value === undefined) return "—"
if (value === null) return "—"
return value.toLocaleString(locale) + "%"
},
time(value: number | undefined) {
if (!value) return "—"
return DateTime.fromMillis(value).setLocale(locale).toLocaleString(DateTime.DATETIME_MED)
},
}
}

Xet Storage Details

Size:
652 Bytes
·
Xet hash:
53af69e0954217848d1190bc7726c35fa4bd2712e9afd1613fc2e458a7b289e0

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.