From 62f86288622ec71c281589ddfc59c0570b5c6c43 Mon Sep 17 00:00:00 2001 From: Ayoub-Mabrouk Date: Thu, 7 Nov 2024 02:19:09 +0100 Subject: [PATCH] Refactor JSDoc for `auth` function: Clarify return type and document errors in JSDoc - Refined the return type in JSDoc to `(Credentials|undefined)` to match the actual return value. - Added `@throws {TypeError}` in JSDoc to document errors thrown for invalid `req` parameter. --- index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 9106e64..05aac23 100644 --- a/index.js +++ b/index.js @@ -49,7 +49,8 @@ var USER_PASS_REGEXP = /^([^:]*):(.*)$/ * Parse the Authorization header field of a request. * * @param {object} req - * @return {object} with .name and .pass + * @throws {TypeError} + * @returns {(Credentials|undefined)} * @public */