(value: any)
| 89 | } |
| 90 | |
| 91 | export 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 | |
| 112 | class SerovalChunkReader { |
| 113 | reader: ReadableStreamDefaultReader<Uint8Array>; |
no outgoing calls
no test coverage detected
searching dependent graphs…