Skip to content

Commit

Permalink
fix: ensure component name suffix (#1544)
Browse files Browse the repository at this point in the history
* fix: ensure component name suffix

* Create fast-rivers-search.md

---------

Co-authored-by: Sami Jaber <[email protected]>
  • Loading branch information
adamdbradley and samijaber authored Sep 3, 2024
1 parent 83feb30 commit 1bf28ea
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/fast-rivers-search.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@builder.io/mitosis": patch
---

Builder: fix: ensure component name suffix
3 changes: 2 additions & 1 deletion packages/core/src/generators/builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ const mapComponentName = (name: string) => {
for (const prefix of builderBlockPrefixes) {
if (name.startsWith(prefix)) {
const suffix = name.replace(prefix, '');
if (isUpperCase(suffix[0])) {
const restOfName = suffix[0];
if (restOfName && isUpperCase(restOfName)) {
return `${prefix}:${name.replace(prefix, '')}`;
}
}
Expand Down

0 comments on commit 1bf28ea

Please sign in to comment.