Skip to content

Commit 2cbd4be

Browse files
committed
chore: refactor as suggested
Signed-off-by: Ruben Romero Montes <[email protected]>
1 parent 3d94485 commit 2cbd4be

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/providers/javascript_yarn.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export default class Javascript_yarn extends Base_javascript {
3030
const version = this._version() ?? '';
3131
const matches = Javascript_yarn.VERSION_PATTERN.exec(version);
3232

33-
if (!matches || matches.length < 2) {
33+
if (!matches?.length < 2) {
3434
throw new Error(`Invalid Yarn version format: ${version}`);
3535
}
3636

src/providers/processors/yarn_berry_processor.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ export default class Yarn_berry_processor extends Yarn_processor {
134134
* @private
135135
*/
136136
#purlFromNode(depName, node) {
137-
if (!node || !node.children || !node.children.Version) {
137+
if (!node?.children?.Version) {
138138
return undefined;
139139
}
140140

0 commit comments

Comments
 (0)