commonMain.com.seiko.imageloader.component.mapper.KtorUrlMapper.kt Maven / Gradle / Ivy
package com.seiko.imageloader.component.mapper
import com.seiko.imageloader.request.Options
import io.ktor.http.Url
class KtorUrlMapper : Mapper {
override fun map(data: Any, options: Options): Url? {
if (data !is String) return null
if (!isApplicable(data)) return null
return Url(data)
}
private fun isApplicable(data: String): Boolean {
return data.startsWith("http")
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy