* Create a new IndexNode 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 {IndexNode} Returns a transformed copy of the node
(callback)
| 127 | * @returns {IndexNode} Returns a transformed copy of the node |
| 128 | */ |
| 129 | map (callback) { |
| 130 | const dimensions = [] |
| 131 | for (let i = 0; i < this.dimensions.length; i++) { |
| 132 | dimensions[i] = this._ifNode( |
| 133 | callback(this.dimensions[i], 'dimensions[' + i + ']', this)) |
| 134 | } |
| 135 | |
| 136 | return new IndexNode(dimensions, this.dotNotation) |
| 137 | } |
| 138 | |
| 139 | /** |
| 140 | * Create a clone of this node, a shallow copy |