MCPcopy
hub / github.com/langfuse/langfuse / stringify

Function stringify

packages/shared/src/server/utils/transforms/stringify.ts:12–19  ·  view source on GitHub ↗
(data: any, key?: string, indent?: number)

Source from the content-addressed store, hash-verified

10};
11
12export const stringify = (data: any, key?: string, indent?: number): string => {
13 // For comment fields, use pretty-print formatting for better readability
14 // Other fields use compact format to reduce file size, unless an explicit
15 // indent is requested by the caller (e.g. human-readable trace downloads).
16 const resolvedIndent = indent ?? (key === "comments" ? 2 : undefined);
17
18 return JSON.stringify(data, stringifyReplacer, resolvedIndent);
19};
20
21/**
22 * CSV-specific stringify that returns strings as-is instead of JSON-encoding them.

Callers 5

transformFunction · 0.90
transformFunction · 0.90
stringify.test.tsFile · 0.90
download.tsFile · 0.90
stringifyForCsvFunction · 0.85

Calls 1

stringifyMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…