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

Method map

src/expression/node/AccessorNode.js:158–164  ·  view source on GitHub ↗

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

(callback)

Source from the content-addressed store, hash-verified

156 * @returns {AccessorNode} Returns a transformed copy of the node
157 */
158 map (callback) {
159 return new AccessorNode(
160 this._ifNode(callback(this.object, 'object', this)),
161 this._ifNode(callback(this.index, 'index', this)),
162 this.optionalChaining
163 )
164 }
165
166 /**
167 * 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