Home / Function/ getHTMLElementName() — astro Function Reference

getHTMLElementName() — astro Function Reference

Architecture documentation for the getHTMLElementName() function in dom.ts from the astro codebase.

Entity Profile

Dependency Diagram

graph TD
  31069517_5643_3068_19ce_b72d5706a2c5["getHTMLElementName()"]
  8ed07f65_b5eb_2959_672d_572dd370f3b4["dom.ts"]
  31069517_5643_3068_19ce_b72d5706a2c5 -->|defined in| 8ed07f65_b5eb_2959_672d_572dd370f3b4
  15d56d87_4e22_4427_af58_92aaeddf9a3b["renderHTMLElement()"]
  15d56d87_4e22_4427_af58_92aaeddf9a3b -->|calls| 31069517_5643_3068_19ce_b72d5706a2c5
  style 31069517_5643_3068_19ce_b72d5706a2c5 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/astro/src/runtime/server/render/dom.ts lines 29–41

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;
}

Domain

Subdomains

Frequently Asked Questions

What does getHTMLElementName() do?
getHTMLElementName() is a function in the astro codebase, defined in packages/astro/src/runtime/server/render/dom.ts.
Where is getHTMLElementName() defined?
getHTMLElementName() is defined in packages/astro/src/runtime/server/render/dom.ts at line 29.
What calls getHTMLElementName()?
getHTMLElementName() is called by 1 function(s): renderHTMLElement.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free