Partial migration of data package to Kotlin
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
package eu.kanade.tachiyomi.util
|
||||
|
||||
import org.jsoup.nodes.Element
|
||||
|
||||
fun Element.selectText(css: String, defaultValue: String? = null): String? {
|
||||
return select(css).first()?.text() ?: defaultValue
|
||||
}
|
||||
|
||||
fun Element.selectInt(css: String, defaultValue: Int = 0): Int {
|
||||
return select(css).first()?.text()?.toInt() ?: defaultValue
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user