Skip to content

Commit

Permalink
refactor: do not depend on deprecated constatnts module
Browse files Browse the repository at this point in the history
  • Loading branch information
kt3k committed Feb 21, 2021
1 parent 24f88fd commit 9f7b7c4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions polyfills.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var constants = require('constants')
var constants = require('fs').constants

var origCwd = process.cwd
var cwd = null
Expand Down Expand Up @@ -31,7 +31,7 @@ function patch (fs) {

// lchmod, broken prior to 0.6.2
// back-port the fix here.
if (constants.hasOwnProperty('O_SYMLINK') &&
if (constants.O_SYMLINK !== undefined &&
process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) {
patchLchmod(fs)
}
Expand Down

0 comments on commit 9f7b7c4

Please sign in to comment.