-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add function to return pacakge purl #122
Conversation
How can this work (purls, i mean) without indicating the registry? A package’s name and version isn’t sufficient to identify a package; you also need to know what registry it comes from. |
262b573
to
2da0729
Compare
@bdehamer can you help me understand how a purl for an npm package can possibly be valid without a registry address? |
There is a notion of a default repository for each package type. However, that doesn't address the case where a different registry is used. I added support for an optional > npa.toPurl('@foo/bar@v1.0.0', 'npm.pkg.github.com')
'pkg:npm/%40foo/bar@v1.0.0?repository_url=npm.pkg.github.com' |
Thanks, that addresses my feedback, assuming that the registry is omitted from the purl by the implementation whenever it equals the default (not just when it's absent) |
Co-authored-by: Jordan Harband <ljharb@gmail.com> Signed-off-by: Brian DeHamer <bdehamer@github.com>
Adds a new
toPurl
function which translates a package name/version into a its purl (Package URL) form.