* 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)
| 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 |