(old, new, with_unchanged=False)
| 71 | |
| 72 | |
| 73 | def diff(old, new, with_unchanged=False): |
| 74 | paths = set(old.keys()) |
| 75 | paths.update(set(new.keys())) |
| 76 | |
| 77 | res: dict[str, dict] = defaultdict(dict) |
| 78 | for path in paths: |
| 79 | path_diff = _diff( |
| 80 | old.get(path, {}).get("data", {}), |
| 81 | new.get(path, {}).get("data", {}), |
| 82 | with_unchanged, |
| 83 | ) |
| 84 | if path_diff: |
| 85 | res[path] = path_diff |
| 86 | return dict(res) |
| 87 | |
| 88 | |
| 89 | def format_dict(d): |