Skip to content

Commit

Permalink
Merge pull request #46 from scragg0x/patch-1
Browse files Browse the repository at this point in the history
fix: use of hasOwnProperty in node version 8
  • Loading branch information
aseemk authored May 31, 2017
2 parents 1b407ec + 7fca87c commit 10faca6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,9 @@ module.exports = function requireDir(dir, opts) {

// otherwise, go through and try each require.extension key!
for (ext in require.extensions) {
// Node v8+ uses "clean" objects w/o hasOwnProperty for require
// again protect against enumerable object prototype extensions:
if (!require.extensions.hasOwnProperty(ext)) {
if (!Object.prototype.hasOwnProperty.call(require.extensions, ext)) {
continue;
}

Expand Down

0 comments on commit 10faca6

Please sign in to comment.