Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Require.resolve fallback on node < 8.10.0 #1404

Merged
merged 4 commits into from
May 30, 2018
Merged

Require.resolve fallback on node < 8.10.0 #1404

merged 4 commits into from
May 30, 2018

Conversation

Akryum
Copy link
Member

@Akryum Akryum commented May 30, 2018

Fix #1396

@Akryum Akryum self-assigned this May 30, 2018
@Akryum Akryum requested a review from yyx990803 May 30, 2018 08:09
Copy link
Contributor

@zigomir zigomir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😉

@@ -0,0 +1,5 @@
exports.minNode = function (major, minor = 0, patch = 0) {
const parts = process.versions.node.split('.').map(v => parseInt(v))
if (parts[0] >= major && parts[1] >= minor && parts[2] >= patch) return true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could return whole expression

@@ -0,0 +1,5 @@
exports.minNode = function (major, minor = 0, patch = 0) {
const parts = process.versions.node.split('.').map(v => parseInt(v))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could use destructuring and give part names like const [major,minor,patch] = ...

i’m aware these are already taken, just suggesting.

}
}

var filename = Module._findPath(request, paths, isMain)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this var while others are const?


var filename = Module._findPath(request, paths, isMain)
if (!filename) {
var err = new Error(`Cannot find module '${request}'`)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above

@Akryum
Copy link
Member Author

Akryum commented May 30, 2018

@zigomir Thanks! ^.^

@yyx990803 yyx990803 merged commit ef2ecf5 into dev May 30, 2018
@LinusBorg LinusBorg deleted the resolve-fallback branch October 14, 2018 16:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants