MCPcopy Create free account
hub / github.com/ampproject/amphtml / assertElement

Function assertElement

src/core/assert/base.js:127–135  ·  view source on GitHub ↗
(assertFn, shouldBeElement, opt_message)

Source from the content-addressed store, hash-verified

125 * @throws {Error} when shouldBeElement is not an Element
126 */
127export function assertElement(assertFn, shouldBeElement, opt_message) {
128 return assertType_(
129 assertFn,
130 shouldBeElement,
131 isElement(shouldBeElement),
132 'Element expected',
133 opt_message
134 );
135}
136
137/**
138 * Throws an error if the first argument isn't a string. The string can

Callers

nothing calls this directly

Calls 2

isElementFunction · 0.90
assertType_Function · 0.85

Tested by

no test coverage detected