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

Function assertNodeType

static/katex/katex.js:6010–6019  ·  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

6008 * typing. Throws if the node's type does not match.
6009 */
6010function assertNodeType(node, type) {
6011 var typedNode = checkNodeType(node, type);
6012
6013 if (!typedNode) {
6014 throw new Error("Expected node of type " + type + ", but got " + (node ? "node of type " + node.type : String(node)));
6015 } // $FlowFixMe: Unsure why.
6016
6017
6018 return typedNode;
6019}
6020/**
6021 * Returns the node more strictly typed iff it is of the given type. Otherwise,
6022 * returns null.

Callers 6

accent_htmlBuilderFunction · 0.70
katex.jsFile · 0.70
parseArrayFunction · 0.70
array_alignedHandlerFunction · 0.70
horizBrace_htmlBuilderFunction · 0.70
op_htmlBuilderFunction · 0.70

Calls 1

checkNodeTypeFunction · 0.70

Tested by

no test coverage detected