* Create a new ArrayNode 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 {ArrayNode} Returns a transformed copy of the node
(callback)
| 82 | * @returns {ArrayNode} Returns a transformed copy of the node |
| 83 | */ |
| 84 | map (callback) { |
| 85 | const items = [] |
| 86 | for (let i = 0; i < this.items.length; i++) { |
| 87 | items[i] = this._ifNode(callback(this.items[i], 'items[' + i + ']', this)) |
| 88 | } |
| 89 | return new ArrayNode(items) |
| 90 | } |
| 91 | |
| 92 | /** |
| 93 | * Create a clone of this node, a shallow copy |