mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-08-29 02:01:50 +08:00
06e9cdf7f6
Common config snippets with array fields (e.g. permissions.deny) were silently overwriting provider-specific entries instead of merging them. This changes deepMerge to append only new elements (deduplicated by bidirectional subset equality), deepRemove to strip one element per source item, and isSubset to use bipartite matching so each source element claims a distinct target element. On the Rust side, the live backfill path now uses a new json_deep_remove_preserving_original_arrays that receives the original provider settings and only removes entries injected by the snippet, preserving entries the provider already had. Type-mismatch guards in both the object and array branches restore the original value when a snippet changes a key's type. Fixes #6141