Skip to content

Commit edb843b

Browse files
Refactor mkdir function in fs utility to simplify promise handling by removing try-catch block.
1 parent 0892fce commit edb843b

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

src/util/fs.ts

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -100,16 +100,7 @@ export const readFileSync = (filePath) => {
100100
*/
101101
export const mkdir = (path) => {
102102
debug(`mkdir called on ${path}`)
103-
104-
return new Promise((resolve, reject) => {
105-
try {
106-
return mkdirp(path)
107-
.then(() => resolve(''))
108-
.catch(error => reject(error))
109-
} catch (error) {
110-
return reject(error)
111-
}
112-
})
103+
return mkdirp(path).then(() => '')
113104
}
114105

115106
/**

0 commit comments

Comments
 (0)