Skip to content
This repository has been archived by the owner on Sep 9, 2023. It is now read-only.

Commit

Permalink
Merge pull request #4 from BridgeAR/future-proof
Browse files Browse the repository at this point in the history
Add compatibility with Node.js 12.
  • Loading branch information
hegemonic authored May 1, 2019
2 parents 86853a6 + 563f9a1 commit cb74458
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
1 change: 0 additions & 1 deletion lib/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

var _ = require('underscore');
var fs = require('fs');
var path = require('path');
var Module = require('module');

var originalWrapper = Module.wrapper.slice(0);
Expand Down
14 changes: 6 additions & 8 deletions lib/requizzle.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
var _ = require('underscore');
var loader = require('./loader');
var Module = require('module');
var path = require('path');

/**
* Function that returns text to swizzle into the module.
Expand Down Expand Up @@ -40,13 +39,12 @@ var path = require('path');
*/

function isNativeModule(targetPath, parentModule) {
var lookupPaths = Module._resolveLookupPaths(targetPath, parentModule);

if (lookupPaths[0] === targetPath && lookupPaths[1].length === 0) {
return true;
}

return false;
var lookupPaths = Module._resolveLookupPaths(targetPath, parentModule, true);
/* istanbul ignore next */
return lookupPaths === null ||
lookupPaths.length === 2 &&
lookupPaths[1].length === 0 &&
lookupPaths[0] === targetPath;
}

/**
Expand Down

0 comments on commit cb74458

Please sign in to comment.