Skip to content

Commit

Permalink
style: format code with StandardJS
Browse files Browse the repository at this point in the history
This commit fixes the style issues introduced in 421acdc according to the output
from StandardJS.

Details: None
  • Loading branch information
deepsource-autofix[bot] authored Dec 26, 2024
1 parent 421acdc commit 7a36f01
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions server/response.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ const fs = require('fs')
const { lookupMimeType } = require('../lib/utils')
const path = require('path')


const STATUS_CODES = Object.freeze({
200: 'OK',
201: 'Created',
Expand All @@ -25,16 +24,15 @@ const STATUS_CODES = Object.freeze({
503: 'Service Unavailable'
})


/**
* Response class for handling HTTP responses.
*
*
* @class Response
*
*
* @param {Socket} socket - The socket object for the response.
* @param {boolean} enableCors - Enable Cross-Origin Resource Sharing (CORS).
* @param {string} statusTextMap - Map of status codes to status texts.
* @example
* @example
* ```javascript
const Response = require('./response.js');
Expand Down Expand Up @@ -68,7 +66,7 @@ class Response {
}

/**
*
*
* @param {number} code - The HTTP status code.
* @returns - The Response instance.
*/
Expand All @@ -81,7 +79,7 @@ class Response {
}

/**
*
*
* @param {string} key - The header key.
* @param {string} value - The header value.
* @returns - The Response instance.
Expand Down Expand Up @@ -113,7 +111,7 @@ class Response {
}

/**
*
*
* @param {string} data - The data to send.
* @returns - If the data is an object or array, send as JSON
*/
Expand Down Expand Up @@ -142,7 +140,7 @@ class Response {
}

/**
*
*
* @param {number} statusCode - The HTTP status code.
* Updates the status code and sends the status code as a response.
*/
Expand All @@ -154,7 +152,7 @@ class Response {
}

/**
*
*
* @param {*} data - The data to send.
*/
json (data) {
Expand All @@ -170,7 +168,7 @@ class Response {
}

/**
*
*
* @param {*} file - The file to send.
*/
sendFile (file) {
Expand Down Expand Up @@ -205,7 +203,7 @@ class Response {
}

/**
*
*
* @param {*} file - The file to send.
* @param {*} filename - The filename to send.
*/
Expand Down

0 comments on commit 7a36f01

Please sign in to comment.