Skip to content

Commit

Permalink
make textDecoder param in decodeText obligatory
Browse files Browse the repository at this point in the history
  • Loading branch information
vadzim committed Feb 28, 2023
1 parent a7a8937 commit c85d221
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions packages/next/src/server/node-web-streams-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@ export function encodeText(input: string) {
return new TextEncoder().encode(input)
}

export function decodeText(input?: Uint8Array, textDecoder?: TextDecoder) {
return textDecoder
? textDecoder.decode(input, { stream: true })
: new TextDecoder().decode(input)
export function decodeText(
input: Uint8Array | undefined,
textDecoder: TextDecoder
) {
return textDecoder.decode(input, { stream: true })
}

export function readableStreamTee<T = any>(
Expand Down

0 comments on commit c85d221

Please sign in to comment.