MCPcopy Create free account
hub / github.com/getsentry/sentry-javascript / getJsonString

Function getJsonString

packages/core/src/tracing/ai/utils.ts:198–203  ·  view source on GitHub ↗
(value: T | T[])

Source from the content-addressed store, hash-verified

196 * Strings are returned as-is, arrays and objects are JSON-stringified.
197 */
198export function getJsonString<T>(value: T | T[]): string {
199 if (typeof value === 'string') {
200 return value;
201 }
202 return JSON.stringify(value);
203}
204
205/**
206 * Get the truncated JSON string for a string or array of strings.

Callers 8

applyFunction · 0.90
addRequestAttributesFunction · 0.90
setMessagesAttributeFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected