to Constraint Or Null
Parses the string as a Constraint and returns the result or null if the string is not a valid representation of a constraint.
Samples
import io.github.z4kn4fein.semver.constraints.Constraint
import io.github.z4kn4fein.semver.constraints.ConstraintSerializer
import io.github.z4kn4fein.semver.constraints.satisfiedBy
import io.github.z4kn4fein.semver.constraints.satisfiedByAll
import io.github.z4kn4fein.semver.constraints.satisfiedByAny
import io.github.z4kn4fein.semver.constraints.toConstraint
import io.github.z4kn4fein.semver.constraints.toConstraintOrNull
import io.github.z4kn4fein.semver.toVersion
import kotlinx.serialization.json.Json
fun main() {
//sampleStart
println(">=1.2".toConstraintOrNull())
println(">=1.2a".toConstraintOrNull())
//sampleEnd
}