feat: Full support for map node types
This commit is contained in:
+1
-11
@@ -1,6 +1,7 @@
|
||||
use super::types::Reducer;
|
||||
use anyhow::{Result, bail};
|
||||
use serde_json::{Number, Value};
|
||||
use crate::graph::type_name;
|
||||
|
||||
/// Combines a branch's incoming write with the current state value (if any)
|
||||
/// via the specified reducer. The result is what gets written back to live
|
||||
@@ -147,17 +148,6 @@ fn number_or_error(value: &Value, reducer_name: &str, position: &str) -> Result<
|
||||
}
|
||||
}
|
||||
|
||||
fn type_name(value: &Value) -> &'static str {
|
||||
match value {
|
||||
Value::Null => "null",
|
||||
Value::Bool(_) => "bool",
|
||||
Value::Number(_) => "number",
|
||||
Value::String(_) => "string",
|
||||
Value::Array(_) => "array",
|
||||
Value::Object(_) => "object",
|
||||
}
|
||||
}
|
||||
|
||||
// Numeric reducers compute in f64 for simplicity. We preserve integer typing
|
||||
// when the result is losslessly representable as i64 so `count: sum` stays an
|
||||
// integer rather than degrading to a float. Non-finite values (NaN, Inf) can't
|
||||
|
||||
Reference in New Issue
Block a user