fix: release ReadableStream reader after iteration completes (#277)

The parseJSON function obtained a ReadableStreamDefaultReader but never called
releaseLock() when iteration finished. This caused Deno's test runner to detect a memory leak with streaming responses.
This commit is contained in:
Bruce MacDonald
2026-02-18 14:06:18 -08:00
committed by GitHub
parent f23d7eeb6d
commit 9c92b18d40
+1
View File
@@ -308,6 +308,7 @@ export const parseJSON = async function* <T = unknown>(
const { done, value: chunk } = await reader.read()
if (done) {
reader.releaseLock()
break
}