Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
niqdev committed Feb 12, 2024
1 parent 6ad1eb7 commit a7acb35
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions modules/bool/src/main/kotlin/com/github/niqdev/todo/sbom.kt
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ data class Sbom(
// https://osv.dev
// TODO semver
sealed interface VulnerabilityPredicate {
data class IsName(val name: String): VulnerabilityPredicate
data class IsVersion(val version: Int): VulnerabilityPredicate
data class IsVersionLessThan(val version: Int): VulnerabilityPredicate
data class AnyVersionIn(val versions: List<Int>): VulnerabilityPredicate
data class IsPackage(val type: PackageType): VulnerabilityPredicate
data class IsName(val name: String) : VulnerabilityPredicate
data class IsVersion(val version: Int) : VulnerabilityPredicate
data class IsVersionLessThan(val version: Int) : VulnerabilityPredicate
data class AnyVersionIn(val versions: List<Int>) : VulnerabilityPredicate
data class IsPackage(val type: PackageType) : VulnerabilityPredicate

companion object {
fun eval(pkg: Package): (VulnerabilityPredicate) -> Boolean = {
Expand Down Expand Up @@ -72,8 +72,8 @@ fun main() {

val fooVulnerability: FreeB<VulnerabilityPredicate> =
pure(VulnerabilityPredicate.IsName("foo")) and
pure(VulnerabilityPredicate.AnyVersionIn(listOf(1, 5, 7))) and
pure(VulnerabilityPredicate.IsPackage(PackageType.APK))
pure(VulnerabilityPredicate.AnyVersionIn(listOf(1, 5, 7))) and
pure(VulnerabilityPredicate.IsPackage(PackageType.APK))

val barVulnerability: FreeB<VulnerabilityPredicate> =
pure(VulnerabilityPredicate.IsName("bar")) and
Expand Down

0 comments on commit a7acb35

Please sign in to comment.