unwrap_values static method
Implementation
static Object? unwrap_values(Object? data) {
if (data == null) return null;
if (data is List) {
return List.generate(
data.length,
(e) => unwrap_value(null, data[e]),
growable: false,
);
} else if (data is Map<String, dynamic>) {
return _replace(
'object',
(_) => Obj.fromJson(data),
data,
) ??
_replace(
'@set',
(value) => {unwrap_values(value)},
data,
) ??
_replace(
'@query',
(value) => QueryResult.fromJson(value),
data,
) ??
_replace(
'@ref',
(value) => RefResult.fromJson(value),
data,
) ??
_replace(
'@ts',
(value) => DateTime.parse(value),
data,
) ??
data.map((key, value) => MapEntry(key, unwrap_value(key, value)));
}
return data;
}