(tag: string)
| 21 | } |
| 22 | |
| 23 | export 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 | |
| 45 | export function styleToString(style: object | string): string { |
| 46 | // Faster escaping process that only looks for the " character. |