* Create a new FunctionAssignmentNode 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 {FunctionAssignmentNode} Returns a transf
(callback)
| 141 | * @returns {FunctionAssignmentNode} Returns a transformed copy of the node |
| 142 | */ |
| 143 | map (callback) { |
| 144 | const expr = this._ifNode(callback(this.expr, 'expr', this)) |
| 145 | |
| 146 | return new FunctionAssignmentNode(this.name, this.params.slice(0), expr) |
| 147 | } |
| 148 | |
| 149 | /** |
| 150 | * Create a clone of this node, a shallow copy |