Skip to content

Commit

Permalink
[ci] yarn format
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathantneal authored and actions-user committed Jan 28, 2022
1 parent 52f8fbe commit 8844bdb
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions packages/astro/src/runtime/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -459,10 +459,14 @@ export async function renderHTMLElement(result: SSRResult, constructor: typeof H

function getHTMLElementName(constructor: typeof HTMLElement) {
const definedName = (customElements as CustomElementRegistry & { getName(_constructor: typeof HTMLElement): string }).getName(constructor);
if (definedName) return definedName

const assignedName = constructor.name.replace(/^HTML|Element$/g, '').replace(/[A-Z]/g, '-$&').toLowerCase().replace(/^-/, 'html-')
return assignedName
if (definedName) return definedName;

const assignedName = constructor.name
.replace(/^HTML|Element$/g, '')
.replace(/[A-Z]/g, '-$&')
.toLowerCase()
.replace(/^-/, 'html-');
return assignedName;
}

function renderElement(name: string, { props: _props, children = '' }: SSRElement) {
Expand Down

0 comments on commit 8844bdb

Please sign in to comment.