Skip to content

Commit

Permalink
fix: layout-put camelcasing
Browse files Browse the repository at this point in the history
  • Loading branch information
DylanPiercey committed Aug 20, 2023
1 parent ff042c6 commit d750dc2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/two-panthers-deny.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"marko-widgets": patch
---

Fix issue where layout-put was not properly camelcasing dashed names
4 changes: 2 additions & 2 deletions packages/marko-widgets/src/components/layout-put/migrate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,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 d750dc2

Please sign in to comment.