mirror of
https://github.com/InsanusMokrassar/MicroUtils.git
synced 2024-11-23 02:28:47 +00:00
commit
ed1baaade7
@ -1,5 +1,11 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## 0.8.6
|
||||||
|
|
||||||
|
* `Common`:
|
||||||
|
* `Either` extensions `onFirst` and `onSecond` now accept not `crossinline` callbacks
|
||||||
|
* All `joinTo` now accept not `crossinline` callbacks
|
||||||
|
|
||||||
## 0.8.5
|
## 0.8.5
|
||||||
|
|
||||||
* `Common`:
|
* `Common`:
|
||||||
|
@ -129,7 +129,7 @@ inline fun <T1, T2> Either.Companion.second(t2: T2): Either<T1, T2> = EitherSeco
|
|||||||
/**
|
/**
|
||||||
* Will call [block] in case when [Either.t1] of [this] is not null
|
* Will call [block] in case when [Either.t1] of [this] is not null
|
||||||
*/
|
*/
|
||||||
inline fun <T1, T2, E : Either<T1, T2>> E.onFirst(crossinline block: (T1) -> Unit): E {
|
inline fun <T1, T2, E : Either<T1, T2>> E.onFirst(block: (T1) -> Unit): E {
|
||||||
val t1 = t1
|
val t1 = t1
|
||||||
t1 ?.let(block)
|
t1 ?.let(block)
|
||||||
return this
|
return this
|
||||||
@ -138,7 +138,7 @@ inline fun <T1, T2, E : Either<T1, T2>> E.onFirst(crossinline block: (T1) -> Uni
|
|||||||
/**
|
/**
|
||||||
* Will call [block] in case when [Either.t2] of [this] is not null
|
* Will call [block] in case when [Either.t2] of [this] is not null
|
||||||
*/
|
*/
|
||||||
inline fun <T1, T2, E : Either<T1, T2>> E.onSecond(crossinline block: (T2) -> Unit): E {
|
inline fun <T1, T2, E : Either<T1, T2>> E.onSecond(block: (T2) -> Unit): E {
|
||||||
val t2 = t2
|
val t2 = t2
|
||||||
t2 ?.let(block)
|
t2 ?.let(block)
|
||||||
return this
|
return this
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
package dev.inmo.micro_utils.common
|
package dev.inmo.micro_utils.common
|
||||||
|
|
||||||
inline fun <I, R> Iterable<I>.joinTo(
|
inline fun <I, R> Iterable<I>.joinTo(
|
||||||
crossinline separatorFun: (I) -> R?,
|
separatorFun: (I) -> R?,
|
||||||
prefix: R? = null,
|
prefix: R? = null,
|
||||||
postfix: R? = null,
|
postfix: R? = null,
|
||||||
crossinline transform: (I) -> R?
|
transform: (I) -> R?
|
||||||
): List<R> {
|
): List<R> {
|
||||||
val result = mutableListOf<R>()
|
val result = mutableListOf<R>()
|
||||||
val iterator = iterator()
|
val iterator = iterator()
|
||||||
@ -29,11 +29,11 @@ inline fun <I, R> Iterable<I>.joinTo(
|
|||||||
separator: R? = null,
|
separator: R? = null,
|
||||||
prefix: R? = null,
|
prefix: R? = null,
|
||||||
postfix: R? = null,
|
postfix: R? = null,
|
||||||
crossinline transform: (I) -> R?
|
transform: (I) -> R?
|
||||||
): List<R> = joinTo({ separator }, prefix, postfix, transform)
|
): List<R> = joinTo({ separator }, prefix, postfix, transform)
|
||||||
|
|
||||||
inline fun <I> Iterable<I>.joinTo(
|
inline fun <I> Iterable<I>.joinTo(
|
||||||
crossinline separatorFun: (I) -> I?,
|
separatorFun: (I) -> I?,
|
||||||
prefix: I? = null,
|
prefix: I? = null,
|
||||||
postfix: I? = null
|
postfix: I? = null
|
||||||
): List<I> = joinTo<I, I>(separatorFun, prefix, postfix) { it }
|
): List<I> = joinTo<I, I>(separatorFun, prefix, postfix) { it }
|
||||||
@ -45,15 +45,15 @@ inline fun <I> Iterable<I>.joinTo(
|
|||||||
): List<I> = joinTo<I>({ separator }, prefix, postfix)
|
): List<I> = joinTo<I>({ separator }, prefix, postfix)
|
||||||
|
|
||||||
inline fun <I, reified R> Array<I>.joinTo(
|
inline fun <I, reified R> Array<I>.joinTo(
|
||||||
crossinline separatorFun: (I) -> R?,
|
separatorFun: (I) -> R?,
|
||||||
prefix: R? = null,
|
prefix: R? = null,
|
||||||
postfix: R? = null,
|
postfix: R? = null,
|
||||||
crossinline transform: (I) -> R?
|
transform: (I) -> R?
|
||||||
): Array<R> = asIterable().joinTo(separatorFun, prefix, postfix, transform).toTypedArray()
|
): Array<R> = asIterable().joinTo(separatorFun, prefix, postfix, transform).toTypedArray()
|
||||||
|
|
||||||
inline fun <I, reified R> Array<I>.joinTo(
|
inline fun <I, reified R> Array<I>.joinTo(
|
||||||
separator: R? = null,
|
separator: R? = null,
|
||||||
prefix: R? = null,
|
prefix: R? = null,
|
||||||
postfix: R? = null,
|
postfix: R? = null,
|
||||||
crossinline transform: (I) -> R?
|
transform: (I) -> R?
|
||||||
): Array<R> = asIterable().joinTo(separator, prefix, postfix, transform).toTypedArray()
|
): Array<R> = asIterable().joinTo(separator, prefix, postfix, transform).toTypedArray()
|
||||||
|
@ -45,5 +45,5 @@ dokka_version=1.5.31
|
|||||||
# Project data
|
# Project data
|
||||||
|
|
||||||
group=dev.inmo
|
group=dev.inmo
|
||||||
version=0.8.5
|
version=0.8.6
|
||||||
android_code_version=85
|
android_code_version=86
|
||||||
|
Loading…
Reference in New Issue
Block a user