session-title.ts 237 B

1234567
  1. const pattern = /^(New session|Child session) - \d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/
  2. export function sessionTitle(title?: string) {
  3. if (!title) return title
  4. const match = title.match(pattern)
  5. return match?.[1] ?? title
  6. }