From 3e767e324a1fccf320791323e0acb308c83c5e9d Mon Sep 17 00:00:00 2001 From: Sebastian Schuberth Date: Tue, 9 Jan 2024 09:40:43 +0100 Subject: [PATCH] feat(model): Add a `toPurl()` overload that takes `PurlExtras` directly Signed-off-by: Sebastian Schuberth --- model/src/main/kotlin/utils/PurlExtensions.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/model/src/main/kotlin/utils/PurlExtensions.kt b/model/src/main/kotlin/utils/PurlExtensions.kt index 63f0b30f8d616..64a618e1e22d6 100644 --- a/model/src/main/kotlin/utils/PurlExtensions.kt +++ b/model/src/main/kotlin/utils/PurlExtensions.kt @@ -74,6 +74,8 @@ fun Identifier.getPurlType() = fun Identifier.toPurl(qualifiers: Map = emptyMap(), subpath: String = "") = if (this == Identifier.EMPTY) "" else createPurl(getPurlType(), namespace, name, version, qualifiers, subpath) +fun Identifier.toPurl(extras: PurlExtras) = toPurl(extras.qualifiers, extras.subpath) + /** * Encode a [KnownProvenance] to extra qualifying data / a subpath of PURL. */