File tree Expand file tree Collapse file tree 1 file changed +12
-12
lines changed Expand file tree Collapse file tree 1 file changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ class LineSplitter extends Stream {
27
27
if ( this . buffer ) {
28
28
this . emit ( 'data' , this . buffer ) ;
29
29
}
30
+ this . writable = false ;
30
31
this . emit ( 'end' ) ;
31
32
}
32
33
}
@@ -52,6 +53,7 @@ class ParagraphParser extends Stream {
52
53
if ( data )
53
54
this . parseLine ( data + '' ) ;
54
55
this . flushParagraph ( ) ;
56
+ this . writable = false ;
55
57
this . emit ( 'end' ) ;
56
58
}
57
59
@@ -211,6 +213,7 @@ class Unwrapper extends Stream {
211
213
end ( data ) {
212
214
if ( data )
213
215
this . write ( data ) ;
216
+ this . writable = false ;
214
217
this . emit ( 'end' ) ;
215
218
}
216
219
}
@@ -272,6 +275,7 @@ class RtfGenerator extends Stream {
272
275
this . write ( data ) ;
273
276
if ( this . didWriteAnything )
274
277
this . emitFooter ( ) ;
278
+ this . writable = false ;
275
279
this . emit ( 'end' ) ;
276
280
}
277
281
@@ -289,15 +293,11 @@ class RtfGenerator extends Stream {
289
293
stdin . setEncoding ( 'utf-8' ) ;
290
294
stdin . resume ( ) ;
291
295
292
- async function main ( ) {
293
- await pipeline (
294
- stdin ,
295
- new LineSplitter ( ) ,
296
- new ParagraphParser ( ) ,
297
- new Unwrapper ( ) ,
298
- new RtfGenerator ( ) ,
299
- stdout ,
300
- ) ;
301
- }
302
-
303
- main ( ) . catch ( console . error ) ;
296
+ await pipeline (
297
+ stdin ,
298
+ new LineSplitter ( ) ,
299
+ new ParagraphParser ( ) ,
300
+ new Unwrapper ( ) ,
301
+ new RtfGenerator ( ) ,
302
+ stdout ,
303
+ ) ;
You can’t perform that action at this time.
0 commit comments