flatten function
Implementation
@visibleForTesting
List<NodeViewModelState> flatten(dynamic object) {
if (object is List) {
return _flattenArray(object as List<NodeViewModelState>);
}
return _flattenClass(object as Map<String, NodeViewModelState>);
}