MCPcopy Index your code
hub / github.com/reflex-dev/reflex / get_changes

Function get_changes

reflex/utils/exec.py:145–159  ·  view source on GitHub ↗

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])

Source from the content-addressed store, hash-verified

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", {}),

Callers 1

get_different_packagesFunction · 0.85

Calls 2

ChangeClass · 0.85
keysMethod · 0.45

Tested by

no test coverage detected