← Public packages
@kody/mailroom
Offline-first PWA for your Kody mailbox: sent and received threads, copy-prompt for agents, no send.
src/version-shape.ts
30 lines · 611 B · TypeScriptexport type AppVersion = {
sha: string
shortSha: string
message: string
committedAt: string
publishedAt: string
}
export function emptyVersion(): AppVersion {
return {
sha: '',
shortSha: '',
message: '',
committedAt: '',
publishedAt: '',
}
}
export function normalizeVersion(
input: Partial<AppVersion> & { sha?: string },
): AppVersion {
const sha = String(input.sha ?? '').trim()
return {
sha,
shortSha: sha.slice(0, 7),
message: String(input.message ?? '').split('\n')[0] ?? '',
committedAt: String(input.committedAt ?? ''),
publishedAt: String(input.publishedAt ?? ''),
}
}