mirror of
https://github.com/MewoLab/AquaDX.git
synced 2026-02-07 23:07:38 +08:00
[O] DIVA utils > kt
This commit is contained in:
@@ -212,6 +212,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)
|
||||
|
||||
Reference in New Issue
Block a user