From 719d1ee6e320c5a64ff277098507ecf38b3f4a85 Mon Sep 17 00:00:00 2001 From: Gregory Marco Date: Sun, 13 Jul 2025 04:28:50 -0500 Subject: [PATCH] import merge_dicts from yagicard --- goat/util.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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