28 return;
29 } else {
30 res.redirect(302, "/sign-in?error=BadInfo");
31 return;32 }
33}
25 maxAge: 604800
26 });
27 res.redirect(302, "/");
28 return;29 } else {
30 res.redirect(302, "/sign-in?error=BadInfo");
31 return;
Return statements are unnecessary if the control flow will naturally exit a function.
function writeToFile(file: string, content: string) {
if (fileExists(file)) {
fs.writeFileSync(file, content)
return // <-- this is not necessary
}
}
function writeToFile(file: string, content: string) {
if (fileExists(file)) {
fs.writeFileSync(file, content);
}