Skip to content

Commit

Permalink
support older node.js versions
Browse files Browse the repository at this point in the history
* don't use incompatible optionals syntax
* add more old node.js versions to testing matrix
  • Loading branch information
justinwoo committed Aug 11, 2023
1 parent 0196d2e commit e9504b9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
6 changes: 4 additions & 2 deletions report.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit e9504b9

Please sign in to comment.