Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
check compatiblity without looking at version number
  • Loading branch information
giltayar committed Nov 12, 2023
1 parent c7b96e1 commit 9c6b400
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 18 deletions.
4 changes: 2 additions & 2 deletions example-esm/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions example/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 3 additions & 5 deletions lib/canRegisterLoader.js
@@ -1,9 +1,7 @@
function canRegisterLoader () {
const [major, minor] = process.versions.node
.split('.')
.map((m) => parseInt(m, 10))
const Module = require('module')

return major > 20 || (major === 20 && minor >= 6)
function canRegisterLoader () {
return !!Module.register
}

exports.canRegisterLoader = canRegisterLoader
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -32,7 +32,7 @@
},
"dependencies": {
"lodash": "^4.17.21",
"resolve": "^1.22.4"
"resolve": "^1.22.8"
},
"devDependencies": {
"core-assert": "^1.0.0",
Expand Down

0 comments on commit 9c6b400

Please sign in to comment.