File tree Expand file tree Collapse file tree 1 file changed +10
-10
lines changed
firebase-common/src/iosMain/kotlin/dev/gitlive/firebase Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -10,13 +10,13 @@ import kotlinx.serialization.SerialDescriptor
10
10
import kotlinx.serialization.StructureKind
11
11
12
12
actual fun FirebaseDecoder.structureDecoder (desc : SerialDescriptor , vararg typeParams : KSerializer <* >): CompositeDecoder = when (desc.kind as StructureKind ) {
13
- StructureKind .CLASS , StructureKind .OBJECT -> (value as Map <* , * >).let { map ->
14
- FirebaseClassDecoder (map.size, { map.containsKey(it) }) { desc, index -> map[desc.getElementName(index)] }
15
- }
16
- StructureKind .LIST -> (value as List <* >).let {
17
- FirebaseCompositeDecoder (it.size) { _, index -> it[index] }
18
- }
19
- StructureKind .MAP -> (value as Map <* , * >).entries.toList().let {
20
- FirebaseCompositeDecoder (it.size) { _, index -> it[index/ 2 ].run { if (index % 2 == 0 ) key else value } }
21
- }
22
- }
13
+ StructureKind .CLASS , StructureKind .OBJECT -> (value as Map <* , * >).let { map ->
14
+ FirebaseClassDecoder (map.size, { map.containsKey(it) }) { desc, index -> map[desc.getElementName(index)] }
15
+ }
16
+ StructureKind .LIST -> (value as List <* >).let {
17
+ FirebaseCompositeDecoder (it.size) { _, index -> it[index] }
18
+ }
19
+ StructureKind .MAP -> (value as Map <* , * >).entries.toList().let {
20
+ FirebaseCompositeDecoder (it.size) { _, index -> it[index/ 2 ].run { if (index % 2 == 0 ) key else value } }
21
+ }
22
+ }
You can’t perform that action at this time.
0 commit comments