1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// Re-exports
pub use indexmap::IndexMap;
pub use serde_json;
pub use serde_json::Value;

pub mod ndjson;
pub mod paths;

/// Defines string representations of the serde JSON [`Value`] types
trait ValueType {
    fn value_type(&self) -> String;
}

impl ValueType for Value {
    fn value_type(&self) -> String {
        match self {
            Value::Object(_) => "Object".to_string(),
            Value::Null => "Null".to_string(),
            Value::Bool(_) => "Bool".to_string(),
            Value::Number(_) => "Number".to_string(),
            Value::String(_) => "String".to_string(),
            Value::Array(_) => "Array".to_string(),
        }
    }
}