Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor createSetHeader for cleaner syntax and improved readability #32

Open
wants to merge 1 commit into
base: 3.x
Choose a base branch
from

Conversation

Ayoub-Mabrouk
Copy link

  • Replaced var with destructured parameter defaults (digits, header, suffix)
  • Used const and let for better scope and immutability
  • Simplified conditional checks and reduced code redundancy

- Replaced `var` with destructured parameter defaults (`digits`, `header`, `suffix`)
- Used `const` and `let` for better scope and immutability
- Simplified conditional checks and reduced code redundancy
@UlisesGascon UlisesGascon changed the base branch from master to 3.x November 1, 2024 12:00
@UlisesGascon UlisesGascon requested a review from carpasse November 1, 2024 12:01
@UlisesGascon UlisesGascon self-assigned this Nov 1, 2024
@UlisesGascon
Copy link
Member

There is a PR that should solve the CI issues: #33

? Boolean(options.suffix)
: true

function createSetHeader ({ digits = 3, header = 'X-Response-Time', suffix = true } = {}) {
Copy link
Member

Choose a reason for hiding this comment

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

This will require a higher minimum Node version, this is ES6 syntax. So this change can go in the next major.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants