Skip to content

Commit

Permalink
Change negative lookbehind to lookahead (#4866)
Browse files Browse the repository at this point in the history
  • Loading branch information
Rishi Raj Jain authored Sep 26, 2022
1 parent 6fd00c4 commit b73ec14
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/astro/src/runtime/server/render/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const STATIC_DIRECTIVES = new Set(['set:html', 'set:text']);

// converts (most) arbitrary strings to valid JS identifiers
const toIdent = (k: string) =>
k.trim().replace(/(?:(?<!^)\b\w|\s+|[^\w]+)/g, (match, index) => {
k.trim().replace(/(?:(?!^)\b\w|\s+|[^\w]+)/g, (match, index) => {
if (/[^\w]|\s/.test(match)) return '';
return index === 0 ? match : match.toUpperCase();
});
Expand Down

0 comments on commit b73ec14

Please sign in to comment.