(pathname: string)
| 7 | } |
| 8 | |
| 9 | export function normalizedPathname(pathname: string) { |
| 10 | const patterns = { |
| 11 | "/playground/mysql/[roomName]": /\/playground\/mysql\/(\w)+/i, |
| 12 | }; |
| 13 | |
| 14 | for (const [pattern, reg] of Object.entries(patterns)) { |
| 15 | if (reg.test(pathname)) { |
| 16 | return pattern; |
| 17 | } |
| 18 | } |
| 19 | |
| 20 | return pathname; |
| 21 | } |
| 22 | |
| 23 | export function sendAnalyticEvents(events: TrackEventItem[]) { |
| 24 | if (typeof window === "undefined") { |
no outgoing calls
no test coverage detected