diff --git a/goat/util.py b/goat/util.py index 8d55048..51dc53b 100644 --- a/goat/util.py +++ b/goat/util.py @@ -13,3 +13,15 @@ def find_nearest(path, test): return None path = parent_path + +def merge_dicts (dicts): + fusion = {} + for source in dicts: + if not source: + continue + + for key, value in source.items(): + if isinstance(value, dict): + value = merge_dicts([fusion.get(key, None), value]) + fusion[key] = value + return fusion