Add newlines

This commit is contained in:
Mikhail Yasnov 2020-04-24 20:09:21 +03:00
parent e258f750b3
commit 0ccfa03486
2 changed files with 4 additions and 0 deletions

View File

@ -3,14 +3,17 @@ package ru.touchinstinct.utils
import org.springframework.data.repository.CrudRepository
fun <T : Any, ID> CrudRepository<T, ID>.update(entity: T, updater: T.() -> Unit): T {
return save(entity.apply(updater))
}
fun <T : Any, ID> CrudRepository<T, ID>.upsert(entity: T, updater: (T) -> Unit): T {
return save(entity.apply(updater))
}
fun <T : Any, ID> T.upsertInto(repository: CrudRepository<T, ID>, updater: (T) -> Unit): T {
return repository.save(also(updater))
}

View File

@ -36,6 +36,7 @@ fun Source.stringify(): String {
fun NodeList.get(localName: String): Node? {
for (i in 0 until length) {
if (item(i).localName == localName) {
return item(i)
}
}