MCPcopy Index your code
hub / github.com/ChrisFeldmeier/OpenCodeRust / merge_json_maps

Function merge_json_maps

crates/opencode-provider/src/bootstrap.rs:1790–1799  ·  view source on GitHub ↗

Merge two JSON option maps, with `overlay` values taking precedence.

(
    base: &HashMap<String, serde_json::Value>,
    overlay: &HashMap<String, serde_json::Value>,
)

Source from the content-addressed store, hash-verified

1788
1789/// Merge two JSON option maps, with `overlay` values taking precedence.
1790fn merge_json_maps(
1791 base: &HashMap<String, serde_json::Value>,
1792 overlay: &HashMap<String, serde_json::Value>,
1793) -> HashMap<String, serde_json::Value> {
1794 let mut result = base.clone();
1795 for (k, v) in overlay {
1796 result.insert(k.clone(), v.clone());
1797 }
1798 result
1799}
1800
1801/// Convert a ConfigModel (from user config) into a ProviderModel, using an
1802/// optional existing model as the base for defaults.

Callers 2

initMethod · 0.85
config_to_provider_modelFunction · 0.85

Calls 1

cloneMethod · 0.45

Tested by

no test coverage detected