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

Method map

src/expression/node/RelationalNode.js:100–105  ·  view source on GitHub ↗

* Create a new RelationalNode 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 {RelationalNode} Returns a transformed copy of the node

(callback)

Source from the content-addressed store, hash-verified

98 * @returns {RelationalNode} Returns a transformed copy of the node
99 */
100 map (callback) {
101 return new RelationalNode(
102 this.conditionals.slice(),
103 this.params.map(
104 (n, i) => this._ifNode(callback(n, 'params[' + i + ']', this)), this))
105 }
106
107 /**
108 * Create a clone of this node, a shallow copy

Callers

nothing calls this directly

Calls 3

_ifNodeMethod · 0.80
mapMethod · 0.65
callbackFunction · 0.50

Tested by

no test coverage detected