Skip to content

Commit

Permalink
fix: layout-placeholder camel-casing
Browse files Browse the repository at this point in the history
  • Loading branch information
DylanPiercey committed Aug 18, 2023
1 parent c6b3b0b commit c9fc240
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/ninety-mails-call.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"marko-widgets": patch
---

Fix issue where layout-placeholder's were not properly being converted to camelCase.
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ export default {
};

function toCamelCase(str: string) {
return str.replace(/(?<=-)[a-z]/g, toUpperCase);
return str.replace(/-([a-z])/g, matchToUpperCase);
}

function toUpperCase(str: string) {
function matchToUpperCase(_: string, str: string) {
return str.toUpperCase();
}

0 comments on commit c9fc240

Please sign in to comment.