* Create a new RangeNode 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 {RangeNode} Returns a transformed copy of the node
(callback)
| 134 | * @returns {RangeNode} Returns a transformed copy of the node |
| 135 | */ |
| 136 | map (callback) { |
| 137 | return new RangeNode( |
| 138 | this._ifNode(callback(this.start, 'start', this)), |
| 139 | this._ifNode(callback(this.end, 'end', this)), |
| 140 | this.step && this._ifNode(callback(this.step, 'step', this)) |
| 141 | ) |
| 142 | } |
| 143 | |
| 144 | /** |
| 145 | * Create a clone of this node, a shallow copy |