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

Open
jsumners-nr opened this issue Jan 3, 2025 · 1 comment
Open

Improve header renaming regular expression #2860

jsumners-nr opened this issue Jan 3, 2025 · 1 comment

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Triage Needed: Unprioritized Features
Development

No branches or pull requests

1 participant