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

Method map

src/expression/node/ConditionalNode.js:111–117  ·  view source on GitHub ↗

* Create a new ConditionalNode whose children are the results of calling * the provided callback function for each child of the original node. * @param {function(child: Node, path: string, parent: Node): Node} callback * @returns {ConditionalNode} Returns a transformed copy of the nod

(callback)

Source from the content-addressed store, hash-verified

109 * @returns {ConditionalNode} Returns a transformed copy of the node
110 */
111 map (callback) {
112 return new ConditionalNode(
113 this._ifNode(callback(this.condition, 'condition', this)),
114 this._ifNode(callback(this.trueExpr, 'trueExpr', this)),
115 this._ifNode(callback(this.falseExpr, 'falseExpr', this))
116 )
117 }
118
119 /**
120 * Create a clone of this node, a shallow copy

Callers

nothing calls this directly

Calls 2

_ifNodeMethod · 0.80
callbackFunction · 0.50

Tested by

no test coverage detected