Commit 25da090 1 parent ad96f2c commit 25da090 Copy full SHA for 25da090
File tree 1 file changed +13
-2
lines changed
1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -131,12 +131,23 @@ async function tryReadErrorReply(reader: BufReader): Promise<never> {
131
131
}
132
132
133
133
async function readLine ( reader : BufReader ) : Promise < Uint8Array > {
134
- const result = await reader . readLine ( ) ;
134
+ let result = await reader . readLine ( ) ;
135
135
if ( result == null ) {
136
136
throw new InvalidStateError ( ) ;
137
137
}
138
138
139
- const { line } = result ;
139
+ let line = result . line ;
140
+
141
+ while ( result ?. more ) {
142
+ result = await reader . readLine ( ) ;
143
+ if ( result == null ) {
144
+ throw new InvalidStateError ( ) ;
145
+ }
146
+ const mergedLine = new Uint8Array ( line . length + result . line . length ) ;
147
+ mergedLine . set ( line ) ;
148
+ mergedLine . set ( result . line , line . length ) ;
149
+ line = mergedLine ;
150
+ }
140
151
return line ;
141
152
}
142
153
You can’t perform that action at this time.
0 commit comments