MCPcopy Create free account
hub / github.com/ccusage/ccusage / string_field

Function string_field

rust/crates/ccusage/src/adapter/codebuff/parser.rs:454–457  ·  view source on GitHub ↗
(record: &serde_json::Map<String, Value>, key: &str)

Source from the content-addressed store, hash-verified

452}
453
454fn string_field(record: &serde_json::Map<String, Value>, key: &str) -> Option<String> {
455 let value = record.get(key)?.as_str()?.trim();
456 (!value.is_empty()).then(|| value.to_string())
457}
458
459fn number_field(record: &serde_json::Map<String, Value>, key: &str) -> f64 {
460 record

Callers 4

extract_assistant_usageFunction · 0.70
parse_usage_objectFunction · 0.70
dedup_keyFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected