Skip to content

[PATCH] readLocationHeader() JSDoc is missing param and returns annotations #170

@ormidales

Description

@ormidales

Category: documentation
Severity: patch
File(s): background.js

Description

readLocationHeader(headers) correctly extracts the HTTP Location response header, but its JSDoc block only contains a prose description. The @param and @returns tags are absent, which prevents IDE tooling from providing type hints and makes the contract less explicit for contributors.

Problematic code example

/**
 * Extracts the value of the HTTP `Location` response header from a header array.
 * Comparison is case-insensitive to match RFC 7230 requirements.
 */
const readLocationHeader = (headers = []) => {  };

Suggested fix

/**
 * Extracts the value of the HTTP `Location` response header from a header array.
 * Comparison is case-insensitive to match RFC 7230 requirements.
 *
 * @param {browser.webRequest.HttpHeader[]} [headers=[]] - Array of response headers.
 * @returns {string} The Location header value, or `""` if absent or malformed.
 */
const readLocationHeader = (headers = []) => {  };

Acceptance criteria

  • @param tag is present with type and description
  • @returns tag is present with type and description
  • Documentation is consistent with other functions in the file

Metadata

Metadata

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions