File tree Expand file tree Collapse file tree 1 file changed +2
-6
lines changed
Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ export class FileSystem {
3434 return createParentDirsIfNeeded ( filePath )
3535 . catch ( createParentDirError => reject ( createParentDirError ) )
3636 . then ( ( ) => {
37- const outfile = createOutfile ( filePath ) ;
37+ const outfile = fs . createWriteStream ( filePath ) ;
3838 stream . once ( 'end' , ( ) => {
3939 zipFile . readEntry ( ) ;
4040 outfile . close ( ) ;
@@ -63,15 +63,11 @@ export class FileSystem {
6363
6464function createParentDirsIfNeeded ( filePath : string ) {
6565 const dirs = path . dirname ( filePath ) . split ( path . sep ) ;
66- return dirs . reduce ( ( p , dir , index ) => p . then ( parent => {
66+ return dirs . reduce ( ( p , dir ) => p . then ( parent => {
6767 const current = `${ parent } ${ path . sep } ${ dir } ` ;
6868
6969 return access ( current )
7070 . catch ( e => mkdir ( current ) )
7171 . then ( ( ) => current ) ;
7272 } ) , Promise . resolve ( '' ) ) ;
7373}
74-
75- function createOutfile ( path : string ) : fs . WriteStream {
76- return fs . createWriteStream ( path ) ;
77- }
You can’t perform that action at this time.
0 commit comments