fix some anti pattern stuff
This commit is contained in:
@@ -8,13 +8,13 @@ import {mkdir} from "fs"
|
||||
* @return {undefined} see: callback
|
||||
*/
|
||||
function ensureExists(path, mask, cb) {
|
||||
if (typeof mask == 'function') { // Allow the `mask` parameter to be optional
|
||||
if (typeof mask === 'function') { // Allow the `mask` parameter to be optional
|
||||
cb = mask;
|
||||
mask = 0o744;
|
||||
}
|
||||
mkdir(path, mask, function (err) {
|
||||
if (err) {
|
||||
if (err.code == 'EEXIST')
|
||||
if (err.code === 'EEXIST')
|
||||
cb(null); // Ignore the error if the folder already exists
|
||||
else
|
||||
cb(err); // Something else went wrong
|
||||
|
||||
Reference in New Issue
Block a user