fix some anti pattern stuff

This commit is contained in:
Mystikfluu
2023-02-10 19:24:05 +01:00
parent 0a46eeee9f
commit 3254d01581
21 changed files with 130 additions and 151 deletions
+2 -2
View File
@@ -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