MCPcopy Create free account
hub / github.com/ethanniser/the-beth-stack / isVoidElement

Function isVoidElement

packages/beth-stack/src/jsx/utils.ts:23–43  ·  view source on GitHub ↗
(tag: string)

Source from the content-addressed store, hash-verified

21}
22
23export function isVoidElement(tag: string): boolean {
24 // Ordered by most common to least common.
25 return (
26 tag === "meta" ||
27 tag === "link" ||
28 tag === "img" ||
29 tag === "br" ||
30 tag === "input" ||
31 tag === "hr" ||
32 tag === "area" ||
33 tag === "base" ||
34 tag === "col" ||
35 tag === "command" ||
36 tag === "embed" ||
37 tag === "keygen" ||
38 tag === "param" ||
39 tag === "source" ||
40 tag === "track" ||
41 tag === "wbr"
42 );
43}
44
45export function styleToString(style: object | string): string {
46 // Faster escaping process that only looks for the " character.

Callers 1

createElementFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected