diff --git a/common/src/commonMain/kotlin/dev/inmo/micro_utils/common/JoinTo.kt b/common/src/commonMain/kotlin/dev/inmo/micro_utils/common/JoinTo.kt index 553c4f77783..ddff9db3da7 100644 --- a/common/src/commonMain/kotlin/dev/inmo/micro_utils/common/JoinTo.kt +++ b/common/src/commonMain/kotlin/dev/inmo/micro_utils/common/JoinTo.kt @@ -25,9 +25,23 @@ inline fun Iterable.joinTo( return result } +inline fun Iterable.joinTo( + separator: R?, + prefix: R?, + postfix: R?, + crossinline transform: (I) -> R? +): List = joinTo({ separator }, prefix, postfix, transform) + inline fun Array.joinTo( crossinline separatorFun: (I) -> R?, prefix: R?, postfix: R?, crossinline transform: (I) -> R? ): Array = asIterable().joinTo(separatorFun, prefix, postfix, transform).toTypedArray() + +inline fun Array.joinTo( + separator: R?, + prefix: R?, + postfix: R?, + crossinline transform: (I) -> R? +): Array = asIterable().joinTo(separator, prefix, postfix, transform).toTypedArray()