forked from alemi/upub
fix: .flat() returning empty arrays
This commit is contained in:
parent
30637f93ee
commit
45c5ea69a6
1 changed files with 2 additions and 1 deletions
|
@ -66,7 +66,8 @@ impl<T : super::Base> Node<T> {
|
|||
arr
|
||||
.into_iter()
|
||||
.filter_map(|node| match node {
|
||||
Node::Empty | Node::Link(_) => None,
|
||||
Node::Empty => None,
|
||||
Node::Link(l) => Some(serde_json::Value::String(l.href().to_string())),
|
||||
Node::Object(o) => Some(o.underlying_json_object()),
|
||||
Node::Array(_) => Some(serde_json::Value::Array(node.flat())),
|
||||
}).collect()
|
||||
|
|
Loading…
Reference in a new issue