Skip to content

Commit 69780c2

Browse files
authored
fix: malformed ingested package versions are fixed (#1246)
--------- Signed-off-by: Jan Kowalleck <[email protected]>
1 parent decc6d8 commit 69780c2

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

HISTORY.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
44

55
## unreleased
66

7+
* Fix
8+
* Malformed ingested package versions are fixed (via [#1246])
9+
10+
[#1246]: https://github.com/CycloneDX/cyclonedx-webpack-plugin/pull/1246
11+
712
## 3.9.0 - 2023-12-10
813

914
* Changed

src/extractor.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ export class Extractor {
6262
const _packageJson = structuredClonePolyfill(pkg.packageJson)
6363
normalizePackageJson(_packageJson as object /* add debug for warnings? */)
6464
// region fix normalizations
65-
if (typeof pkg.packageJson === 'string') {
65+
if (typeof pkg.packageJson.version === 'string') {
6666
// allow non-SemVer strings
67-
_packageJson.version = pkg.packageJson.trim()
67+
_packageJson.version = pkg.packageJson.version.trim()
6868
}
6969
// endregion fix normalizations
7070
pkg.packageJson = _packageJson

0 commit comments

Comments
 (0)