aboutsummaryrefslogtreecommitdiff
path: root/core/src/main/kotlin
diff options
context:
space:
mode:
authorsebastian.sellmair <sebastian.sellmair@jetbrains.com>2020-08-25 14:28:44 +0200
committerSebastian Sellmair <34319766+sellmair@users.noreply.github.com>2020-08-31 15:10:04 +0200
commit29cc17ba80018e3e45a5fabcf2e370c735fd5674 (patch)
tree4845c0d56582c290c69427769a032e8a017c2773 /core/src/main/kotlin
parent333091e5c5f896769c3371dd74c87a52ffa9562a (diff)
downloaddokka-29cc17ba80018e3e45a5fabcf2e370c735fd5674.tar.gz
dokka-29cc17ba80018e3e45a5fabcf2e370c735fd5674.tar.bz2
dokka-29cc17ba80018e3e45a5fabcf2e370c735fd5674.zip
Implement ModuleAndPackageDocumentationReader
Diffstat (limited to 'core/src/main/kotlin')
-rw-r--r--core/src/main/kotlin/utilities/associateWithNotNull.kt6
1 files changed, 6 insertions, 0 deletions
diff --git a/core/src/main/kotlin/utilities/associateWithNotNull.kt b/core/src/main/kotlin/utilities/associateWithNotNull.kt
new file mode 100644
index 00000000..ea2e8c3c
--- /dev/null
+++ b/core/src/main/kotlin/utilities/associateWithNotNull.kt
@@ -0,0 +1,6 @@
+package org.jetbrains.dokka.utilities
+
+inline fun <K, V : Any> Iterable<K>.associateWithNotNull(valueSelector: (K) -> V?): Map<K, V> {
+ @Suppress("UNCHECKED_CAST")
+ return associateWith { valueSelector(it) }.filterValues { it != null } as Map<K, V>
+}