MCPcopy Index your code
hub / github.com/solidjs/solid-start / serializeToJSONStream

Function serializeToJSONStream

packages/start/src/fns/serialization.ts:91–110  ·  view source on GitHub ↗
(value: any)

Source from the content-addressed store, hash-verified

89}
90
91export function serializeToJSONStream(value: any) {
92 return new ReadableStream({
93 start(controller) {
94 toCrossJSONStream(value, {
95 disabledFeatures: DISABLED_FEATURES,
96 depthLimit: MAX_SERIALIZATION_DEPTH_LIMIT,
97 plugins: DEFAULT_PLUGINS,
98 onParse(node) {
99 controller.enqueue(createChunk(JSON.stringify(node)));
100 },
101 onDone() {
102 controller.close();
103 },
104 onError(error) {
105 controller.error(error);
106 },
107 });
108 },
109 });
110}
111
112class SerovalChunkReader {
113 reader: ReadableStreamDefaultReader<Uint8Array>;

Callers 2

handleServerFunctionFunction · 0.90
serializeToJSONStringFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…