MCPcopy
hub / github.com/josdejong/mathjs / _ifNode

Method _ifNode

src/expression/node/Node.js:105–110  ·  view source on GitHub ↗

* Validate whether an object is a Node, for use with map * @param {Node} node * @returns {Node} Returns the input if it's a node, else throws an Error * @protected

(node)

Source from the content-addressed store, hash-verified

103 * @protected
104 */
105 _ifNode (node) {
106 if (!isNode(node)) {
107 throw new TypeError('Callback function must return a Node')
108 }
109 return node
110 }
111
112 /**
113 * Recursively traverse all nodes in a node tree. Executes given callback for

Callers 12

mapMethod · 0.80
mapMethod · 0.80
mapMethod · 0.80
mapMethod · 0.80
mapMethod · 0.80
mapMethod · 0.80
mapMethod · 0.80
mapMethod · 0.80
mapMethod · 0.80
mapMethod · 0.80
mapMethod · 0.80
mapMethod · 0.80

Calls 1

isNodeFunction · 0.90

Tested by

no test coverage detected