Skip to content

Conversation

@cloutiertyler
Copy link
Contributor

Description of Changes

API and ABI breaking changes

Expected complexity level and risk

Testing

* @returns The converted string
*/
export function toCamelCase<T extends string>(str: T): CamelCase<T> {
return str.replace(/[-_]+(\w)/g, (_, c) => c.toUpperCase()) as CamelCase<T>;

Check failure

Code scanning / CodeQL

Polynomial regular expression used on uncontrolled data High

This
regular expression
that depends on
library input
may run slow on strings with many repetitions of '-'.
This
regular expression
that depends on
library input
may run slow on strings with many repetitions of '-'.
This
regular expression
that depends on
library input
may run slow on strings with many repetitions of '-'.
This
regular expression
that depends on
library input
may run slow on strings with many repetitions of '-'.
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.

2 participants