MCPcopy Create free account
hub / github.com/ChrisFeldmeier/OpenCodeRust / copy_first

Function copy_first

crates/opencode-plugin/src/subprocess/loader.rs:520–529  ·  view source on GitHub ↗
(
    source: &Map<String, Value>,
    target: &mut Map<String, Value>,
    target_key: &str,
    candidate_keys: &[&str],
)

Source from the content-addressed store, hash-verified

518}
519
520fn copy_first(
521 source: &Map<String, Value>,
522 target: &mut Map<String, Value>,
523 target_key: &str,
524 candidate_keys: &[&str],
525) {
526 if let Some(value) = first_value(source, candidate_keys) {
527 target.insert(target_key.to_string(), value);
528 }
529}
530
531fn synthesize_model(source: &Map<String, Value>) -> Option<Value> {
532 let model_id = first_value(source, &["modelID", "model_id"])?;

Callers 1

hook_io_from_contextFunction · 0.85

Calls 1

first_valueFunction · 0.85

Tested by

no test coverage detected