Closed KennethWussmann closed 4 years ago
Will this be merged into master?
Please, can this be merged? I tried to work around the access using reflection, but of course, there is no reflection available in JS.
Thanks for this useful library!
Is there any particular reason why this PR can't be merged?
It seems like this project is no longer actively maintained.
When you are on the JVM you can use reflections to bypass the access restriction:
fun <T> ValidationResult<T>.errors(): Map<List<String>, List<String>> {
return if (this is Invalid) {
val errorsProp = this::class.memberProperties.first { it.name == "errors" }
errorsProp.getter.call(this) as Map<List<String>, List<String>>
} else emptyMap()
}
Hey! This fixes #3. As there was no real result from the issue comments and I think everyone would be fine to at least have access to the
errors
, the easiest way would be to just expose theerrors
map to everyone.Thanks, Kenneth