We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b0bbfa9 commit a0f3543Copy full SHA for a0f3543
1 file changed
index.js
@@ -14,14 +14,14 @@ var multer = new Multer({
14
const destination = join(PATH, 'static');
15
16
try {
17
- const stat = await FS.stat(destination);
18
- if (!stat.isDirectory()) {
+ await FS.stat(destination);
+ return callback(null, destination);
19
+ } catch (error) {
20
+ if (error.code === 'ENOENT') {
21
await FS.mkdir(destination);
22
return callback(null, destination);
23
}
24
- return callback(null, destination);
- } catch (error) {
25
return callback(error);
26
27
},
0 commit comments