Lightweight Kotlin Multiplatform utility extensions.
- Nullable number and boolean defaults.
- Safe string conversion, slicing, wrapping, prefix/suffix, and query parsing helpers.
- List rotation, chunking, duplicate detection, and safe element replacement.
- Mutable list and mutable map helpers with safe in-place operations.
- Map inversion, grouping, merging, flattening, and typed filtering.
- Shared JSON defaults and safe serialization helpers based on
kotlinx.serialization. - Callback-based exception handling helpers.
Add the dependency to commonMain:
kotlin {
sourceSets {
commonMain.dependencies {
implementation("com.airsaid:ktx:$version")
}
}
}Make sure Maven Central is available:
repositories {
mavenCentral()
}import com.airsaid.ktx.*
val count = "42".toIntSafe()
val title = "Kotlin Multiplatform".ellipsize(maxLength = 6)
val params = "page=1&sort=latest".toQueryMap()
val rotated = listOf(1, 2, 3, 4).rotateRight(1)
val duplicates = listOf(1, 2, 2, 3).duplicates()Detailed documentation: ktx/README.md
- Android: minSdk 24, compileSdk 36, JVM target 17
- iOS: iosArm64, iosX64, iosSimulatorArm64
- Kotlin: 2.2.21
- Changelog: CHANGELOG.md
- Releasing: docs/releasing.md
Apache-2.0. See LICENSE.