Get the changes between two dictionaries. Args: old: The old dictionary of packages. new: The new dictionary of packages. Returns: A `Change` named tuple containing the added and removed packages.
(old: dict[str, str], new: dict[str, str])
| 143 | """ |
| 144 | |
| 145 | def get_changes(old: dict[str, str], new: dict[str, str]) -> Change: |
| 146 | """Get the changes between two dictionaries. |
| 147 | |
| 148 | Args: |
| 149 | old: The old dictionary of packages. |
| 150 | new: The new dictionary of packages. |
| 151 | |
| 152 | Returns: |
| 153 | A `Change` named tuple containing the added and removed packages. |
| 154 | """ |
| 155 | old_keys = set(old.keys()) |
| 156 | new_keys = set(new.keys()) |
| 157 | added = new_keys - old_keys |
| 158 | removed = old_keys - new_keys |
| 159 | return Change(added=added, removed=removed) |
| 160 | |
| 161 | dependencies_change = get_changes( |
| 162 | old_package_json_content.get("dependencies", {}), |
no test coverage detected