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

Improve header renaming regular expression #2860

Closed
jsumners-nr opened this issue Jan 3, 2025 · 1 comment · Fixed by #2887
Closed

Improve header renaming regular expression #2860

jsumners-nr opened this issue Jan 3, 2025 · 1 comment · Fixed by #2887
Assignees

Comments

@jsumners-nr
Copy link
Contributor

// Converts headers in the form 'header-name' to be in the form 'headerName'
// eslint-disable-next-line sonarjs/slow-regex
return newHeader.replace(/[\W_]+(\w)/g, function capitalize(m, $1) {
return $1.toUpperCase()
})

This regular expression is triggering sonar-js's "slow regex" rule. We need to investigate what the regular expression does, and see if we can improve it.

@workato-integration
Copy link

@newrelic-node-agent-team newrelic-node-agent-team moved this to Triage Needed: Unprioritized Features in Node.js Engineering Board Jan 3, 2025
@jsumners-nr jsumners-nr self-assigned this Jan 16, 2025
@jsumners-nr jsumners-nr moved this from Triage Needed: Unprioritized Features to In progress: Issues being worked on in Node.js Engineering Board Jan 16, 2025
@github-project-automation github-project-automation bot moved this from In progress: Issues being worked on to Done: Issues recently completed in Node.js Engineering Board Jan 16, 2025
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 a pull request may close this issue.

1 participant