Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf: optimize consumeEnd #2510

Merged
merged 12 commits into from
Dec 9, 2023
Prev Previous commit
fix: json
  • Loading branch information
tsctx committed Dec 8, 2023
commit a8be777aa130b30c0dd253a4a43bc6c29cb95873
2 changes: 1 addition & 1 deletion lib/api/readable.js
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ function consumeEnd (consume) {
if (type === 'text') {
resolve(chunksDecode(body, length))
} else if (type === 'json') {
resolve(chunksDecode(body, length))
resolve(JSON.parse(chunksDecode(body, length)))
} else if (type === 'arrayBuffer') {
const dst = new Uint8Array(length)

Expand Down
Loading