[O] DIVA repos > kt

This commit is contained in:
Azalea
2025-10-25 07:14:43 +08:00
parent acf76bd270
commit 32c3226db7
55 changed files with 355 additions and 598 deletions

View File

@@ -228,6 +228,7 @@ fun Str.fromChusanUsername() = String(this.toByteArray(StandardCharsets.ISO_8859
fun Str.truncate(len: Int) = if (this.length > len) this.take(len) + "..." else this
val Str.some get() = ifBlank { null }
val ByteArray.hexStr get() = toHexString()
operator fun StringBuilder.plusAssign(other: String) { this.append(other) }
// Coroutine
suspend fun <T> async(block: suspend kotlinx.coroutines.CoroutineScope.() -> T): T = withContext(Dispatchers.IO) { block() }