And couldn't we use recursion for childLayers as well?

```
        function browse(node, config) {
            config = config || {};
            for (var i = 0, leni = node.length; i < leni; i++) {
                var child = node[i];
                var children = child.children || child.childLayers;
                if (children) {
                    browse(children, config);
                } else {
                    config[child.name] = child;
                }
            }
            return config;
        }
```