File tree Expand file tree Collapse file tree 2 files changed +7
-8
lines changed Expand file tree Collapse file tree 2 files changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ async function main() {
17
17
}
18
18
19
19
process . stdout . write ( '\n' ) ;
20
-
20
+
21
21
// Explicitly exit after stream completion
22
22
process . exit ( 0 ) ;
23
23
} catch ( error ) {
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ abstract class BaseSSEDecoder implements SSEDecoder {
24
24
if ( ! response . body ) {
25
25
throw new Error ( 'Response body is null' ) ;
26
26
}
27
-
27
+
28
28
yield * this . _iterLines ( this . getReader ( response ) ) ;
29
29
}
30
30
@@ -73,18 +73,17 @@ export class NodeSSEDecoder extends BaseSSEDecoder {
73
73
async start ( controller ) {
74
74
try {
75
75
for await ( const chunk of stream ) {
76
- const uint8Array = typeof chunk === 'string'
77
- ? new TextEncoder ( ) . encode ( chunk )
78
- : chunk instanceof Uint8Array
79
- ? chunk
80
- : new Uint8Array ( chunk ) ;
76
+ const uint8Array =
77
+ typeof chunk === 'string' ? new TextEncoder ( ) . encode ( chunk )
78
+ : chunk instanceof Uint8Array ? chunk
79
+ : new Uint8Array ( chunk ) ;
81
80
controller . enqueue ( uint8Array ) ;
82
81
}
83
82
controller . close ( ) ;
84
83
} catch ( error ) {
85
84
controller . error ( error ) ;
86
85
}
87
- }
86
+ } ,
88
87
} ) ;
89
88
return webStream . getReader ( ) ;
90
89
}
You can’t perform that action at this time.
0 commit comments