Skip to content

Commit 86f2b88

Browse files
committed
Fixed unecessary function and parameter
1 parent 15247ca commit 86f2b88

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

lib/wrappers/file-system.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff 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

6464
function 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-
}

0 commit comments

Comments
 (0)