mirror of
https://github.com/anomalyco/opencode.git
synced 2026-04-24 06:45:22 +00:00
8 lines
237 B
TypeScript
8 lines
237 B
TypeScript
const pattern = /^(New session|Child session) - \d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/
|
|
|
|
export function sessionTitle(title?: string) {
|
|
if (!title) return title
|
|
const match = title.match(pattern)
|
|
return match?.[1] ?? title
|
|
}
|