(insight: string)
| 17 | |
| 18 | // Helper to parse the prismaQuery value and extract the payload |
| 19 | function parseQueryInsight(insight: string): { prefix: string; payload?: unknown } { |
| 20 | const colonIndex = insight.indexOf(':') |
| 21 | if (colonIndex === -1) { |
| 22 | return { prefix: insight } |
| 23 | } |
| 24 | const prefix = insight.slice(0, colonIndex) |
| 25 | const encoded = insight.slice(colonIndex + 1) |
| 26 | const payload = JSON.parse(fromBase64Url(encoded)) |
| 27 | return { prefix, payload } |
| 28 | } |
| 29 | |
| 30 | describe('prismaQueryInsights plugin', () => { |
| 31 | it('returns prismaQuery tag', () => { |
no test coverage detected