diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3d1db32..0ceadae 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -9,7 +9,7 @@ jobs: strategy: matrix: - node-version: [18.x, 20.x] + node-version: [10.x, 12.x, 14.x, 18.x, 20.x] steps: - uses: actions/checkout@v2 @@ -30,7 +30,7 @@ jobs: strategy: matrix: - node-version: [18.x, 20.x] + node-version: [10.x, 12.x, 14.x, 18.x, 20.x] steps: - uses: actions/checkout@v2 @@ -51,7 +51,7 @@ jobs: strategy: matrix: - node-version: [18.x, 20.x] + node-version: [10.x, 12.x, 14.x, 18.x, 20.x] steps: - uses: actions/checkout@v2 diff --git a/report.js b/report.js index d3b01e0..40d9e6e 100644 --- a/report.js +++ b/report.js @@ -74,8 +74,10 @@ function skipTraversal (rootPackage) { } function parentIsRoot (dependencyToReport) { - return dependencyToReport?.parent?.name === dependencyToReport?.rootPackage?.name && - dependencyToReport?.parent?.version === dependencyToReport?.rootPackage?.version + const parent = dependencyToReport.parent + const rootPackage = dependencyToReport.rootPackage + + return parent && rootPackage && parent.name === rootPackage.name && parent.version === rootPackage.version } function isTopLevel (dependencyToReport) {