decodeObject function
Map<String, Object?>
decodeObject(
- LineCursor cursor,
- int baseDepth,
- ResolvedDecodeOptions options
Decodes an object from the cursor
Implementation
Map<String, Object?> decodeObject(
LineCursor cursor, int baseDepth, ResolvedDecodeOptions options) {
final obj = <String, Object?>{};
while (!cursor.atEnd()) {
final line = cursor.peek();
if (line == null || line.depth < baseDepth) {
break;
}
if (line.depth == baseDepth) {
final (key, value) = decodeKeyValuePair(line, cursor, baseDepth, options);
obj[key] = value;
} else {
break;
}
}
return obj;
}