Skip to content

Commit

Permalink
♻️ Update NotBlankString.Companion.create(Any?) function (#341)
Browse files Browse the repository at this point in the history
  • Loading branch information
LVMVRQUXL committed Feb 21, 2024
1 parent 8b71e6e commit 33f9e8c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/commonMain/kotlin/kotools/types/text/NotBlankString.kt
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ public value class NotBlankString private constructor(
@JvmSynthetic
public fun create(value: Any?): NotBlankString {
val text: String = value.toString()
require(text.isNotBlank()) { ErrorMessage.blankString }
val isValid: Boolean = text.isNotBlank()
require(isValid) { ErrorMessage.blankString }
return NotBlankString(text)
}

Expand Down

0 comments on commit 33f9e8c

Please sign in to comment.