packageurl-js
Advanced tools
Comparing version 0.0.3 to 0.0.4
@@ -0,1 +1,9 @@ | ||
# 0.0.4 | ||
### Bug Fixes | ||
* Properly handle PyPI `purl` values per the purl-spec [#18](https://github.com/package-url/packageurl-js/pull/18) | ||
# 0.0.3 | ||
### Bug Fixes | ||
* Properly handle `undefined` or `null` qualifier values [#16](https://github.com/package-url/packageurl-js/issues/16) | ||
# 0.0.2 | ||
@@ -32,2 +40,2 @@ | ||
* Initial release | ||
* Initial release |
{ | ||
"name": "packageurl-js", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"description": "JavaScript library to parse and build \"purl\" aka. package URLs. This is a microlibrary implementing the purl spec at https://github.com/package-url", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -59,5 +59,13 @@ /* | ||
_handlePyPi() { | ||
this.name = this.name.toLowerCase().replace('_', '-'); | ||
} | ||
toString() { | ||
var purl = ['pkg:', this.type, '/']; | ||
if (this.type === 'pypi') { | ||
this._handlePyPi(); | ||
} | ||
if (this.namespace) { | ||
@@ -64,0 +72,0 @@ purl.push(encodeURIComponent(this.namespace).replace('%3A', ':')); |
@@ -70,4 +70,10 @@ /* | ||
}); | ||
it('should handle pypi package-urls per the purl-spec', function () { | ||
const purlMixedCasing = PackageURL.fromString('pkg:pypi/PYYaml@5.3.0'); | ||
assert.strictEqual(purlMixedCasing.toString(), 'pkg:pypi/pyyaml@5.3.0'); | ||
const purlWithUnderscore = PackageURL.fromString('pkg:pypi/typing_extensions@1.0.0'); | ||
assert.strictEqual(purlWithUnderscore.toString(), 'pkg:pypi/typing-extensions@1.0.0'); | ||
}); | ||
} | ||
}); | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
30186
679