add knownMimeTypesMap
This commit is contained in:
parent
2e2632caae
commit
96217eb3ed
@ -8,8 +8,6 @@ interface MimeType {
|
||||
}
|
||||
data class CustomMimeType(override val raw: String) : MimeType
|
||||
|
||||
private const val imageMainType = "image"
|
||||
|
||||
sealed class KnownMimeTypes(override val raw: String) : MimeType {
|
||||
object Any : MimeType, KnownMimeTypes("*/*")
|
||||
sealed class Application(raw: String) : MimeType, KnownMimeTypes(raw) {
|
||||
@ -1437,6 +1435,10 @@ internal val knownMimeTypes: Set<MimeType> = setOf(
|
||||
KnownMimeTypes.XConference.XCooltalk,
|
||||
)
|
||||
|
||||
fun findBuiltinMimeType(from: String): MimeType? {
|
||||
return knownMimeTypes.firstOrNull { it.raw == from }
|
||||
val knownMimeTypesMap by lazy {
|
||||
knownMimeTypes.associateBy { it.raw }
|
||||
}
|
||||
|
||||
fun findBuiltinMimeType(from: String): MimeType? {
|
||||
return knownMimeTypesMap[from]
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user