All Downloads are FREE. Search and download functionalities are using the official Maven repository.

jvmMain.io.kotest.matchers.reflection.extensions.kt Maven / Gradle / Ivy

package io.kotest.matchers.reflection

import kotlin.reflect.KClass
import kotlin.reflect.KVisibility
import kotlin.reflect.full.declaredFunctions
import kotlin.reflect.full.memberProperties

internal fun KClass<*>.findFunction(name: String) = declaredFunctions.firstOrNull { it.name == name }
internal fun KClass<*>.findMemberProperty(name: String) = memberProperties.firstOrNull { it.name == name }
internal fun KVisibility.humanName() =
   name.lowercase().replaceFirstChar { if (it.isLowerCase()) it.titlecase() else it.toString() }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy