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

View file

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