From 3d911f0165e8d693088d2d05a9bfcf6c14d53491 Mon Sep 17 00:00:00 2001 From: Sebastian Schuberth Date: Tue, 9 Jan 2024 22:35:04 +0100 Subject: [PATCH] chore(model): Make newly added PURL extension function public This is a fixup for 758fd7a to be able to use these functions from plugins. Signed-off-by: Sebastian Schuberth --- model/src/main/kotlin/utils/PurlExtensions.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/model/src/main/kotlin/utils/PurlExtensions.kt b/model/src/main/kotlin/utils/PurlExtensions.kt index 64a618e1e22d6..4813c5a5f7209 100644 --- a/model/src/main/kotlin/utils/PurlExtensions.kt +++ b/model/src/main/kotlin/utils/PurlExtensions.kt @@ -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}" @@ -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('&')