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

Function assertAtomFamily

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

6039 */
6040
6041function assertAtomFamily(node, family) {
6042 var typedNode = checkAtomFamily(node, family);
6043
6044 if (!typedNode) {
6045 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)));
6046 }
6047
6048 return typedNode;
6049}
6050/**
6051 * Returns the node more strictly typed iff it is of the given type. Otherwise,
6052 * returns null.

Callers 1

katex.jsFile · 0.70

Calls 1

checkAtomFamilyFunction · 0.70

Tested by

no test coverage detected