1
0
Fork 0
forked from svrjs/svrjs

Replace some ES5-style functions with ES6-style ones

This commit is contained in:
Dorian Niemiec 2024-08-27 21:53:37 +02:00
parent 12a4bcdc8a
commit 4506d38eac
2 changed files with 6 additions and 6 deletions

View file

@ -183,7 +183,7 @@ function clientErrorHandler(err, socket) {
fs.access(
"." + errorCode.toString(),
fs.constants.F_OK,
function (err) {
(err) => {
try {
if (err) {
callback(errorCode.toString() + ".html");
@ -207,7 +207,7 @@ function clientErrorHandler(err, socket) {
fs.access(
"." + errorCode.toString(),
fs.constants.F_OK,
function (err) {
(err) => {
try {
if (err) {
callback(errorCode.toString() + ".html");

View file

@ -343,8 +343,8 @@ function requestHandler(req, res) {
}
// Determine error file
function getErrorFileName(list, callback, _i) {
function medCallback(p) {
const getErrorFileName = (list, callback, _i) => {
const medCallback = (p) => {
if (p) callback(p);
else {
if (errorCode == 404) {
@ -353,7 +353,7 @@ function requestHandler(req, res) {
fs.access(
"." + errorCode.toString(),
fs.constants.F_OK,
function (err) {
(err) => {
try {
if (err) {
callback(errorCode.toString() + ".html");
@ -377,7 +377,7 @@ function requestHandler(req, res) {
fs.access(
"." + errorCode.toString(),
fs.constants.F_OK,
function (err) {
(err) => {
try {
if (err) {
callback(errorCode.toString() + ".html");