fix(fs): writeFile with ReadableStream throws (#2907)

This commit is contained in:
Tony
2025-08-10 18:44:33 +08:00
committed by GitHub
parent b8056f484c
commit 4eb36b0ff5
4 changed files with 103 additions and 96 deletions
File diff suppressed because one or more lines are too long
+6 -1
View File
@@ -1074,7 +1074,12 @@ async function writeFile(
}
if (data instanceof ReadableStream) {
const file = await open(path, { create: true, ...options })
const file = await open(path, {
read: false,
create: true,
write: true,
...options
})
const reader = data.getReader()
try {