MCPcopy Index your code
hub / github.com/ampproject/amphtml / isVoidElement

Function isVoidElement

testing/helpers/index.js:100–104  ·  view source on GitHub ↗

* Returns true of node is a void element. * @see https://developer.mozilla.org/en-US/docs/Glossary/Empty_element * * @param {Node} node * @return {boolean}

(node)

Source from the content-addressed store, hash-verified

98 * @return {boolean}
99 */
100function isVoidElement(node) {
101 return (
102 node.nodeType === Node.ELEMENT_NODE && VOID_ELEMENTS.has(node.nodeName)
103 );
104}
105
106/**
107 * Returns the outerHTML for an element, but with lexicographically sorted attributes.

Callers 1

Calls 1

hasMethod · 0.45

Tested by

no test coverage detected