MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / as_object

Function as_object

atomic-canonical/src/delegation.rs:609–613  ·  view source on GitHub ↗
(value: &Value)

Source from the content-addressed store, hash-verified

607}
608
609fn as_object(value: &Value) -> Result<&Map<String, Value>> {
610 value
611 .as_object()
612 .ok_or_else(|| CanonicalError::Proof("document is not a JSON object".into()))
613}
614
615fn expect_type(value: &Value, expected: &str) -> Result<()> {
616 let actual = as_object(value)?.get("@type").and_then(Value::as_str);

Callers 4

parseFunction · 0.85
verify_requestFunction · 0.85
verify_revocationFunction · 0.85
expect_typeFunction · 0.85

Calls 1

ProofClass · 0.85

Tested by

no test coverage detected