serializeValue
Callable
Parameters
value: unknown
optionalcontentType: string
Returns { contentType: string; value: Buffer | ArrayBuffer | ArrayBufferView | string | NodeJS.ReadableStream | ReadableStream }
contentType: string
value: Buffer | ArrayBuffer | ArrayBufferView | string | NodeJS.ReadableStream | ReadableStream
Canonical write path for key-value store records.
When a content type is provided, the value passes through unchanged — it is the caller's responsibility to supply a String/Buffer/Stream (the frontend validates this).
When no content type is provided, it is inferred from the value's shape:
application/octet-stream(passthrough)string→text/plain; charset=utf-8(passthrough)application/json; charset=utf-8(serialized viajsonStringifyExtended)Does NOT drain streams — that is storage mechanics and stays in the storage backend.
Backend-independent.