feat: Full support for map node types

This commit is contained in:
2026-05-20 15:15:58 -06:00
parent 36ac924d77
commit 7154c3a652
5 changed files with 229 additions and 30 deletions
+1 -11
View File
@@ -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