MCPcopy Create free account
hub / github.com/TruthHun/BookStack / assertAtomFamily

Function assertAtomFamily

static/katex/katex.mjs:6007–6015  ·  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, family)

Source from the content-addressed store, hash-verified

6005 */
6006
6007function assertAtomFamily(node, family) {
6008 const typedNode = checkAtomFamily(node, family);
6009
6010 if (!typedNode) {
6011 throw new Error(`Expected node of type "atom" and family "${family}", but got ` + (node ? node.type === "atom" ? `atom of family ${node.family}` : `node of type ${node.type}` : String(node)));
6012 }
6013
6014 return typedNode;
6015}
6016/**
6017 * Returns the node more strictly typed iff it is of the given type. Otherwise,
6018 * returns null.

Callers 1

handlerFunction · 0.70

Calls 1

checkAtomFamilyFunction · 0.70

Tested by

no test coverage detected