summaryrefslogtreecommitdiffhomepage
path: root/packages/app/src/utils/session-title.ts
blob: ca04c010470ceefa741f3a2a34acddab31033cb3 (plain)
1
2
3
4
5
6
7
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
}