refactor: improve `toClassName` function readability and JSDoc completeness by Ayoub-Mabrouk · Pull Request #112 · jshttp/http-errors · GitHub
Skip to content

refactor: improve toClassName function readability and JSDoc completeness#112

Merged
wesleytodd merged 1 commit into
jshttp:masterfrom
Ayoub-Mabrouk:chore/toClassName
Nov 12, 2024
Merged

refactor: improve toClassName function readability and JSDoc completeness#112
wesleytodd merged 1 commit into
jshttp:masterfrom
Ayoub-Mabrouk:chore/toClassName

Conversation

@Ayoub-Mabrouk

Copy link
Copy Markdown
Contributor

refactor: improve toClassName function readability and JSDoc completeness

  • Replaced substr with slice for better readability and consistency.
  • Updated JSDoc to include @param and @returns tags for clarity on function inputs and outputs.
  • Simplified the conditional logic by using slice(-5) === 'Error' for a concise and clear check.

@wesleytodd wesleytodd left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While I am not a huge fan of PR's with changes like the code reformatting which do not have meaningful behavior changes (so maybe try to avoid those in the future) I think it is more readable, and the JSDoc updates are also good. Since this PR has been open for 5 days and has now two approvals I think we can merge.

…ness

- Replaced substr with slice for better readability and consistency.
- Updated JSDoc to include @param and @returns tags for clarity on function inputs and outputs.
- Simplified the conditional logic by using slice(-5) === 'Error' for a concise and clear check.
@wesleytodd wesleytodd merged commit d8899ba into jshttp:master Nov 12, 2024
@Ayoub-Mabrouk

Ayoub-Mabrouk commented Nov 12, 2024

Copy link
Copy Markdown
Contributor Author

@wesleytodd

Copy link
Copy Markdown
Member

Comment thread index.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants