Repository: plotly/dash
File: dash/dash-renderer/src/actions/utils.js (JavaScript)

Code before:
                    if (front.length) {
                        crawlLayout(
                            rpath(front, child),
                            func,
                            concat(currentPath, concat([i], front)),
                            back
                        );
                    } else {
                        const backPath = back
                            .map(p => p.replace('{}', ''))
                            .filter(e => e);
                        let childObj,
                            childPath = concat([i], backPath);
                        if (backPath.length) {
                            childObj = rpath(backPath, child);
                        } else {
                            childObj = child;
                        }
                        Object.keys(childObj).forEach(key => {
                            const value = childObj[key];
                            crawlLayout(
                                value,
                                func,
                                concat(currentPath, childPath.concat([key]))
                            );
                        });
                    }
                } else {
                    crawlLayout(
                        rpath(extraPath, child),
                        func,
                        concat(currentPath, concat([i], extraPath))
                    );
                }
            } else {
                crawlLayout(child, func, append(i, currentPath));
            }
        });
    } else if (type(object) === 'Object') {
        func(object, currentPath);

        const children = path(propsChildren, object);
        if (children) {
            const newPath = concat(currentPath, propsChildren);
            crawlLayout(children, func, newPath);
        }

        const childrenProps = pathOr(
            [],
            [object.namespace, object.type],
            window.__dashprivate_childrenProps

Review comment (suggestion):
Not a big deal, just a little cleaner. Same at [line 143](https://github.com/plotly/dash/pull/2207/files#diff-7547342484ca8c69ce2849cd1e8f7e8819b751cbd91e3f315368ca6f397b896dR143)
```suggestion
                        for (const key in childObj) {
                            const value = childObj[key];
                            crawlLayout(
                                value,
                                func,
                                concat(currentPath, childPath.concat([key]))
                            );
                        }
```

Code after:
                        crawlLayout(
                            path(front, child),
                            func,
                            concat(currentPath, concat([i], front)),
                            back
                        );
                    } else {
                        const backPath = back
                            .map(p => p.replace('{}', ''))
                            .filter(e => e);
                        let childObj,
                            childPath = concat([i], backPath);
                        if (backPath.length) {
                            childObj = path(backPath, child);
                        } else {
                            childObj = child;
                        }
                        for (const key in childObj) {
                            const value = childObj[key];
                            crawlLayout(
                                value,
                                func,
                                concat(currentPath, childPath.concat([key]))
                            );
                        }
                    }
                } else {
                    crawlLayout(
                        path(extraPath, child),
                        func,
                        concat(currentPath, concat([i], extraPath))
                    );
                }
            } else {
                crawlLayout(child, func, append(i, currentPath));
            }
        });
    } else if (type(object) === 'Object') {
        func(object, currentPath);

        const children = path(propsChildren, object);
        if (children) {
            const newPath = concat(currentPath, propsChildren);
            crawlLayout(children, func, newPath);
        }

        const childrenProps = pathOr(
            [],
            [object.namespace, object.type],
            window.__dashprivate_childrenProps
        );