[-] Drop the codebase (#187)

Co-authored-by: Raymond <protogenraymond@gmail.com>
This commit is contained in:
Azalea
2026-02-09 05:44:42 +08:00
committed by GitHub
parent 6c4c9337e7
commit 50a9a2bdd0
492 changed files with 4754 additions and 17022 deletions

View File

@@ -217,6 +217,8 @@ val <K, V> Map<K, V>.mut get() = toMutableMap()
val <T> Set<T>.mut get() = toMutableSet()
fun <T> List<T>.unique(fn: (T) -> Any) = distinctBy(fn).ifEmpty { null }
val <T> Collection<T>.csv get() = joinToString(",")
val IntArray.csv get() = joinToString(",")
// Optionals
operator fun <T> Optional<T>.invoke(): T? = orElse(null)
@@ -233,6 +235,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() }
@@ -261,6 +264,7 @@ operator fun <E> List<E>.component13(): E = get(12)
inline operator fun <reified E> List<Any?>.invoke(i: Int) = get(i) as E
val empty = emptyList<Any>()
val emptyMap = emptyMap<Any, Any>()
val <F> Pair<F, *>.l get() = component1()
val <S> Pair<*, S>.r get() = component2()