Skip to content

Commit

Permalink
feat(model): Add a toPurl() overload that takes PurlExtras directly
Browse files Browse the repository at this point in the history
Signed-off-by: Sebastian Schuberth <[email protected]>
  • Loading branch information
sschuberth committed Jan 9, 2024
1 parent 758fd7a commit 3e767e3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions model/src/main/kotlin/utils/PurlExtensions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ fun Identifier.getPurlType() =
fun Identifier.toPurl(qualifiers: Map<String, String> = 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.
*/
Expand Down

0 comments on commit 3e767e3

Please sign in to comment.