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

Function checkNodeType

static/katex/katex.js:6025–6035  ·  view source on GitHub ↗

* Returns the node more strictly typed iff it is of the given type. Otherwise, * returns null.

(node, type)

Source from the content-addressed store, hash-verified

6023 */
6024
6025function checkNodeType(node, type) {
6026 if (node && node.type === type) {
6027 // The definition of ParseNode<TYPE> doesn't communicate to flow that
6028 // `type: TYPE` (as that's not explicitly mentioned anywhere), though that
6029 // happens to be true for all our value types.
6030 // $FlowFixMe
6031 return node;
6032 }
6033
6034 return null;
6035}
6036/**
6037 * Asserts that the node is of the given type and returns it with stricter
6038 * typing. Throws if the node's type does not match.

Callers 8

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

Calls

no outgoing calls

Tested by

no test coverage detected