(event: EventOrSession | undefined)
| 19 | } |
| 20 | |
| 21 | export function normalize(event: EventOrSession | undefined): EventOrSession | undefined { |
| 22 | if (event === undefined) { |
| 23 | return undefined; |
| 24 | } |
| 25 | |
| 26 | if (eventIsSession(event)) { |
| 27 | return normalizeSession(event as Session); |
| 28 | } else { |
| 29 | return normalizeEvent(event as Event); |
| 30 | } |
| 31 | } |
| 32 | |
| 33 | export function eventIsSession(data: EventOrSession): boolean { |
| 34 | return !!(data as Session)?.sid; |
no test coverage detected