* Create a new OperatorNode 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 {OperatorNode} Returns a transformed copy of the node
(callback)
| 351 | * @returns {OperatorNode} Returns a transformed copy of the node |
| 352 | */ |
| 353 | map (callback) { |
| 354 | const args = [] |
| 355 | for (let i = 0; i < this.args.length; i++) { |
| 356 | args[i] = this._ifNode(callback(this.args[i], 'args[' + i + ']', this)) |
| 357 | } |
| 358 | return new OperatorNode( |
| 359 | this.op, this.fn, args, this.implicit, this.isPercentage) |
| 360 | } |
| 361 | |
| 362 | /** |
| 363 | * Create a clone of this node, a shallow copy |