MCPcopy Index your code
hub / github.com/TruthHun/BookStack / assertNodeType

Function assertNodeType

static/katex/katex.mjs:5976–5985  ·  view source on GitHub ↗

* Asserts that the node is of the given type and returns it with stricter * typing. Throws if the node's type does not match.

(node, type)

Source from the content-addressed store, hash-verified

5974 * typing. Throws if the node's type does not match.
5975 */
5976function assertNodeType(node, type) {
5977 const typedNode = checkNodeType(node, type);
5978
5979 if (!typedNode) {
5980 throw new Error(`Expected node of type ${type}, but got ` + (node ? `node of type ${node.type}` : String(node)));
5981 } // $FlowFixMe: Unsure why.
5982
5983
5984 return typedNode;
5985}
5986/**
5987 * Returns the node more strictly typed iff it is of the given type. Otherwise,
5988 * returns null.

Callers 7

htmlBuilderFunction · 0.70
handlerFunction · 0.70
katex.mjsFile · 0.70
parseArrayFunction · 0.70
alignedHandlerFunction · 0.70
htmlBuilder$7Function · 0.70
htmlBuilder$8Function · 0.70

Calls 1

checkNodeTypeFunction · 0.70

Tested by

no test coverage detected