MCPcopy
hub / github.com/prisma/prisma / parseQueryInsight

Function parseQueryInsight

packages/sqlcommenter-query-insights/src/index.test.ts:19–28  ·  view source on GitHub ↗
(insight: string)

Source from the content-addressed store, hash-verified

17
18// Helper to parse the prismaQuery value and extract the payload
19function 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
30describe('prismaQueryInsights plugin', () => {
31 it('returns prismaQuery tag', () => {

Callers 1

index.test.tsFile · 0.70

Calls 4

indexOfMethod · 0.80
fromBase64UrlFunction · 0.70
parseMethod · 0.65
sliceMethod · 0.45

Tested by

no test coverage detected