Function: serializeValue()
Prefactor TypeScript SDK / @prefactor/core / serializeValue
Function: serializeValue()
Section titled “Function: serializeValue()”serializeValue(
value,maxLength?):unknown
Defined in: packages/core/src/utils/serialization.ts:29
Serialize a value for JSON output, handling non-serializable types and truncating long strings
Parameters
Section titled “Parameters”unknown
Value to serialize
maxLength?
Section titled “maxLength?”Maximum length for strings (null for no truncation)
number | null
Returns
Section titled “Returns”unknown
Serialized value
Example
Section titled “Example”const serialized = serializeValue({ message: 'Hello'.repeat(1000) }, 100);// Result: { message: 'HelloHelloHello... [truncated]' }