Skip to content

Commit

Permalink
Cleanup OciRepositoryHandler
Browse files Browse the repository at this point in the history
  • Loading branch information
SgtSilvio committed Jul 18, 2024
1 parent 1c3ca74 commit 6b88c72
Showing 1 changed file with 3 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -372,24 +372,18 @@ private fun JsonObjectStringBuilder.addCapabilities(
componentId: VersionedCoordinates,
) {
if (capabilities != setOf(componentId)) {
addCapabilities(key, capabilities, "")
addCapabilities(key, capabilities, null)
}
}

private fun JsonObjectStringBuilder.addCapabilities(
key: String,
capabilities: Set<VersionedCoordinates>,
platform: Platform,
) = addCapabilities(key, capabilities, createPlatformPostfix(platform))

private fun JsonObjectStringBuilder.addCapabilities(
key: String,
capabilities: Set<VersionedCoordinates>,
featureName: String,
platform: Platform?,
) = addArray(key, capabilities) { capability ->
addObject {
addString("group", capability.group)
addString("name", capability.name + featureName)
addString("name", capability.name + createPlatformPostfix(platform))
addString("version", capability.version)
}
}
Expand Down

0 comments on commit 6b88c72

Please sign in to comment.