File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import { EventEmitter } from 'events';
22import path from 'path' ;
33import { vinylFileSync } from 'vinyl-file' ;
44import File from 'vinyl' ;
5- import { type PipelineTransform , Readable , Duplex } from 'stream' ;
5+ import { type PipelineTransform , Readable , Transform } from 'stream' ;
66import { pipeline } from 'stream/promises' ;
77
88// eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -31,14 +31,14 @@ export function isFileTransform<StoreFile extends { path: string } = File>(
3131
3232export function loadFile ( filepath : string ) : File {
3333 try {
34- return vinylFileSync ( filepath ) ;
34+ return vinylFileSync ( filepath ) as unknown as File ;
3535 } catch ( err ) {
3636 return new File ( {
3737 cwd : process . cwd ( ) ,
3838 base : process . cwd ( ) ,
3939 path : filepath ,
4040 contents : null ,
41- } ) ;
41+ } ) as unknown as File ;
4242 }
4343}
4444
@@ -155,10 +155,12 @@ export class Store<StoreFile extends { path: string } = File> extends EventEmitt
155155 Readable . from ( iterablefilter ( this . store . values ( ) ) ) as any ,
156156 // eslint-disable-next-line @typescript-eslint/no-explicit-any
157157 ...( transforms as any ) ,
158- Duplex . from ( async ( generator : AsyncGenerator < StoreFile > ) => {
159- for await ( const file of generator ) {
158+ new Transform ( {
159+ objectMode : true ,
160+ transform ( file : StoreFile , _encoding , callback ) {
160161 addFile ?.( file ) ;
161- }
162+ callback ( null ) ;
163+ } ,
162164 } ) ,
163165 ) ;
164166
You can’t perform that action at this time.
0 commit comments