File tree Expand file tree Collapse file tree 3 files changed +4
-4
lines changed Expand file tree Collapse file tree 3 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ export default class Javascript_yarn extends Base_javascript {
30
30
const version = this . _version ( ) ?? '' ;
31
31
const matches = Javascript_yarn . VERSION_PATTERN . exec ( version ) ;
32
32
33
- if ( ! matches || matches . length < 2 ) {
33
+ if ( matches ? .length !== 2 ) {
34
34
throw new Error ( `Invalid Yarn version format: ${ version } ` ) ;
35
35
}
36
36
Original file line number Diff line number Diff line change @@ -134,7 +134,7 @@ export default class Yarn_berry_processor extends Yarn_processor {
134
134
* @private
135
135
*/
136
136
#purlFromNode( depName , node ) {
137
- if ( ! node || ! node . children || ! node . children . Version ) {
137
+ if ( ! node ? .children ? .Version ) {
138
138
return undefined ;
139
139
}
140
140
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ export default class Yarn_classic_processor extends Yarn_processor {
40
40
* @returns {Map<string, PackageURL> } Map of dependency names to their PackageURL objects
41
41
*/
42
42
getRootDependencies ( depTree ) {
43
- if ( ! depTree || ! depTree . data || ! depTree . data . trees ) {
43
+ if ( ! depTree ? .data ? .trees ) {
44
44
return new Map ( ) ;
45
45
}
46
46
@@ -63,7 +63,7 @@ export default class Yarn_classic_processor extends Yarn_processor {
63
63
* @param {Object } depTree - The dependency tree object
64
64
*/
65
65
addDependenciesToSbom ( sbom , depTree ) {
66
- if ( ! depTree || ! depTree . data || ! depTree . data . trees ) {
66
+ if ( ! depTree ? .data ? .trees ) {
67
67
return ;
68
68
}
69
69
You can’t perform that action at this time.
0 commit comments