//! Shared utility functions.
use simd_json::OwnedValue as Value;
use simd_json::StaticNode;
/// Get the JSON type name for a value.
pub fn type_name(value: &Value) -> &'static str {
match value {
Value::Static(StaticNode::Null) => "null",
Value::Static(StaticNode::Bool(_)) => "boolean",
Value::Static(StaticNode::I64(_) | StaticNode::U64(_) | StaticNode::F64(_)) => "number",
Value::String(_) => "string",
Value::Array(_) => "array",
Value::Object(_) => "object",
}
}