Package modulecheck.utils

Types

Link copied to clipboard
sealed class CaseMatcher(val regex: Regex)

https://gist.github.com/SuppieRK/a6fb471cf600271230c8c7e532bdae4b

Link copied to clipboard
class IndentScope(val indent: String, val stringBuilder: StringBuilder)

Functions

Link copied to clipboard
inline fun <T : Any, E> T.applyEach(elements: Iterable<E>, block: T.(E) -> Unit): T
Link copied to clipboard
inline fun <T> T.applyIf(predicate: Boolean, body: T.() -> T): T
Link copied to clipboard
fun String.capitalize(locale: Locale = Locale.US): String
Link copied to clipboard
inline fun <T> Any.cast(): T
Link copied to clipboard
fun File.child(vararg childPath: String): File
fun Path.child(vararg childPath: String): File
Link copied to clipboard
fun File.createSafely(content: String? = null): File
Link copied to clipboard
fun String.decapitalize(locale: Locale = Locale.US): String
Link copied to clipboard
fun File.existsOrNull(): File?
Link copied to clipboard
fun File.findMinimumIndent(): String
fun String.findMinimumIndent(absoluteMinimum: String = " "): String
Link copied to clipboard
inline fun <T, R> Iterable<T>.flatMapToSet(destination: MutableSet<R> = mutableSetOf(), transform: (T) -> Iterable<R>): Set<R>
inline fun <T, R> Sequence<T>.flatMapToSet(destination: MutableSet<R> = mutableSetOf(), transform: (T) -> Iterable<R>): Set<R>
Link copied to clipboard
fun StringBuilder.indent(indent: String, action: IndentScope.() -> Unit)
Link copied to clipboard
fun String.indentByBrackets(tab: String = " "): String

A naive auto-indent which just counts brackets.

Link copied to clipboard
private fun String.indentWidth(): Int
Link copied to clipboard
infix fun <T> Comparable<T>.isGreaterThan(other: T): Boolean
Link copied to clipboard
inline fun <T> T.letIf(predicate: Boolean, body: (T) -> T): T
Link copied to clipboard
inline fun <C : Collection<T>, T, R> C.mapToSet(destination: MutableSet<R> = mutableSetOf(), transform: (T) -> R): Set<R>
Link copied to clipboard
fun File.mkdirsInline(): File

Creates the directories if they don't already exist

Link copied to clipboard
fun String.prefixIfNot(prefix: String): String
Link copied to clipboard
fun String.remove(vararg strings: String): String
fun String.remove(vararg patterns: Regex): String
Link copied to clipboard
inline fun String.replaceDestructured(regex: Regex, crossinline transform: (group1: String) -> String): String
inline fun String.replaceDestructured(regex: Regex, crossinline transform: (group1: String, group2: String) -> String): String
inline fun String.replaceDestructured(regex: Regex, crossinline transform: (group1: String, group2: String, group3: String) -> String): String
inline fun String.replaceDestructured(regex: Regex, crossinline transform: (group1: String, group2: String, group3: String, group4: String) -> String): String
inline fun String.replaceDestructured(regex: Regex, crossinline transform: (group1: String, group2: String, group3: String, group4: String, group5: String) -> String): String
Link copied to clipboard
inline fun <T : Any> T?.requireNotNull(): T
inline fun <T : Any> T?.requireNotNull(lazyMessage: () -> Any): T
Link copied to clipboard
inline fun <T : Any> Any?.safeAs(): T?
Link copied to clipboard
fun <T> Iterable<T>.sortedWith(vararg selectors: (T) -> Comparable<*>): List<T>
fun <T> Sequence<T>.sortedWith(vararg selectors: (T) -> Comparable<*>): Sequence<T>

Returns a list of all elements sorted according to the specified selectors.

Link copied to clipboard
fun <T> Iterable<T>.sortedWithDescending(vararg selectors: (T) -> Comparable<*>): List<T>

Returns a list of all elements sorted according to the specified selectors.

Link copied to clipboard
fun String.suffixIfNot(suffix: String): String