Type Checking

This commit is contained in:
Tben
2023-08-07 05:10:45 +01:00
parent 65d6424dcf
commit 4da665efd4
4 changed files with 12 additions and 8 deletions
+6 -3
View File
@@ -1,8 +1,11 @@
// @ts-check
/**
* ==============================================================================
* Imports
* ==============================================================================
*/
const http = require("http");
/**
* Parse request cookies
@@ -13,9 +16,9 @@
* @async
*
* @param {object} params - main params object
* @param {object} params.request - HTTPS request object
* @param {http.IncomingMessage} params.request - HTTPS request object
*
* @returns {object|null}
* @returns {* | null}
*/
module.exports = function ({ request }) {
/**
@@ -28,7 +31,7 @@ module.exports = function ({ request }) {
////////////////////////////////////////
////////////////////////////////////////
/** @type {string|null} */
/** @type {string | undefined} */
const cookieString = request.headers.cookie;
if (!cookieString || typeof cookieString !== "string") {