MCPcopy Index your code
hub / github.com/promptfoo/promptfoo / getBodyStringForFetchCacheKey

Function getBodyStringForFetchCacheKey

src/cache.ts:362–374  ·  view source on GitHub ↗
(value: string)

Source from the content-addressed store, hash-verified

360}
361
362function getBodyStringForFetchCacheKey(value: string): unknown {
363 try {
364 const parsedValue = JSON.parse(value);
365 return hasSensitiveJsonValue(parsedValue)
366 ? {
367 encoding: 'json',
368 value: getJsonValueForFetchCacheKey(parsedValue),
369 }
370 : value;
371 } catch {
372 return getStringForFetchCacheKey(value);
373 }
374}
375
376function hasSensitiveSearchParam(searchParams: URLSearchParams) {
377 return Array.from(searchParams.entries()).some(([name, value]) =>

Callers 1

getBodyForFetchCacheKeyFunction · 0.85

Calls 4

hasSensitiveJsonValueFunction · 0.85
parseMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…