package com.marvinelsen.moedict.internal

import com.marvinelsen.moedict.api.MoedictEntry
import com.marvinelsen.moedict.api.MoedictParser
import kotlinx.serialization.ExperimentalSerializationApi
import kotlinx.serialization.json.Json
import kotlinx.serialization.json.decodeFromStream
import java.io.InputStream

internal class JsonMoedictParser : MoedictParser {
    @OptIn(ExperimentalSerializationApi::class)
    override fun parse(inputStream: InputStream) = Json.decodeFromStream<List<MoedictEntry>>(inputStream)
}
