Skip to content

Commit

Permalink
chore(model): Make newly added PURL extension function public
Browse files Browse the repository at this point in the history
This is a fixup for 758fd7a to be able to use these functions from
plugins.

Signed-off-by: Sebastian Schuberth <[email protected]>
  • Loading branch information
sschuberth committed Jan 10, 2024
1 parent 69fe155 commit 3d911f0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions model/src/main/kotlin/utils/PurlExtensions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ fun Identifier.toPurl(extras: PurlExtras) = toPurl(extras.qualifiers, extras.sub
/**
* Encode a [KnownProvenance] to extra qualifying data / a subpath of PURL.
*/
internal fun KnownProvenance.toPurlExtras(): PurlExtras =
fun KnownProvenance.toPurlExtras(): PurlExtras =
when (this) {
is ArtifactProvenance -> with(sourceArtifact) {
val checksum = "${hash.algorithm.name.lowercase()}:${hash.value}"
Expand All @@ -104,7 +104,7 @@ internal fun KnownProvenance.toPurlExtras(): PurlExtras =
* Decode [Provenance] from extra qualifying data / a subpath of the PURL represented by this [String]. Return
* [UnknownProvenance] if extra data is not present.
*/
internal fun String.toProvenance(): Provenance {
fun String.toProvenance(): Provenance {
val extras = substringAfter('?')

fun getQualifierValue(name: String) = extras.substringAfter("$name=").substringBefore('&')
Expand Down

0 comments on commit 3d911f0

Please sign in to comment.