forked from svrjs/svrjs
Lint out the codebase
This commit is contained in:
parent
5a3e6765f1
commit
fd5e8ba70e
4 changed files with 41 additions and 42 deletions
13
src/index.js
13
src/index.js
|
@ -687,7 +687,9 @@ if (!disableMods) {
|
|||
// If there was another error, try creating the temp folder and then the modloader folder again
|
||||
fs.mkdirSync(process.dirname + "/temp");
|
||||
try {
|
||||
fs.mkdirSync(process.dirname + "/temp/" + modloaderFolderName);
|
||||
fs.mkdirSync(
|
||||
process.dirname + "/temp/" + modloaderFolderName,
|
||||
);
|
||||
} catch (err) {
|
||||
// If there was another error, throw it
|
||||
if (err.code != "EEXIST") throw err;
|
||||
|
@ -696,8 +698,13 @@ if (!disableMods) {
|
|||
}
|
||||
|
||||
// Create a subfolder for the current mod within the modloader folder
|
||||
fs.mkdirSync(process.dirname + "/temp/" + modloaderFolderName + "/" + modFileRaw);
|
||||
|
||||
fs.mkdirSync(
|
||||
process.dirname +
|
||||
"/temp/" +
|
||||
modloaderFolderName +
|
||||
"/" +
|
||||
modFileRaw,
|
||||
);
|
||||
} catch (err) {
|
||||
// If there was an error creating the folder, ignore it if it's a known error
|
||||
if (err.code != "EEXIST" && err.code != "ENOENT") throw err;
|
||||
|
|
|
@ -199,11 +199,7 @@ module.exports = (req, res, logFacilities, config, next) => {
|
|||
if (cacheEntry) {
|
||||
cb(cacheEntry.hash);
|
||||
} else {
|
||||
crypto.scrypt(
|
||||
password,
|
||||
list[_i].salt,
|
||||
64,
|
||||
(err, derivedKey) => {
|
||||
crypto.scrypt(password, list[_i].salt, 64, (err, derivedKey) => {
|
||||
if (err) {
|
||||
res.error(500, err);
|
||||
} else {
|
||||
|
@ -216,8 +212,7 @@ module.exports = (req, res, logFacilities, config, next) => {
|
|||
});
|
||||
cb(key);
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
} else if (list[_i].pbkdf2) {
|
||||
|
|
|
@ -9,9 +9,7 @@ module.exports = (req, res, logFacilities, config, next) => {
|
|||
req.originalParsedURL.pathname[req.originalParsedURL.pathname.length - 1] !=
|
||||
"/"
|
||||
) {
|
||||
fs.stat(
|
||||
"." + decodeURIComponent(req.parsedURL.pathname),
|
||||
(err, stats) => {
|
||||
fs.stat("." + decodeURIComponent(req.parsedURL.pathname), (err, stats) => {
|
||||
if (err || !stats.isDirectory()) {
|
||||
try {
|
||||
next();
|
||||
|
@ -26,8 +24,7 @@ module.exports = (req, res, logFacilities, config, next) => {
|
|||
req.parsedURL.hash,
|
||||
);
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
} else {
|
||||
next();
|
||||
}
|
||||
|
|
|
@ -119,7 +119,7 @@ if (!process.singleThreaded) {
|
|||
let oldLog = console.log;
|
||||
console.log = (...params) => {
|
||||
if (
|
||||
a == "ChildProcess.prototype.send() - Sorry! Not implemented yet"
|
||||
params[0] == "ChildProcess.prototype.send() - Sorry! Not implemented yet"
|
||||
) {
|
||||
throw new Error("NOT IMPLEMENTED");
|
||||
} else {
|
||||
|
|
Reference in a new issue