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

Function checkNodeType

static/katex/katex.mjs:5991–6001  ·  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

5989 */
5990
5991function checkNodeType(node, type) {
5992 if (node && node.type === type) {
5993 // The definition of ParseNode<TYPE> doesn't communicate to flow that
5994 // `type: TYPE` (as that's not explicitly mentioned anywhere), though that
5995 // happens to be true for all our value types.
5996 // $FlowFixMe
5997 return node;
5998 }
5999
6000 return null;
6001}
6002/**
6003 * Asserts that the node is of the given type and returns it with stricter
6004 * typing. Throws if the node's type does not match.

Callers 11

assertNodeTypeFunction · 0.70
ordargumentFunction · 0.70
buildExpressionFunction · 0.70
htmlBuilderFunction · 0.70
alignedHandlerFunction · 0.70
handlerFunction · 0.70
htmlBuilder$7Function · 0.70
htmlBuilder$8Function · 0.70
mathmlBuilderFunction · 0.70
handleInfixNodesMethod · 0.70
parseAtomMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected