diff --git a/lib/requizzle.js b/lib/requizzle.js index 21b58d5..312bc7b 100644 --- a/lib/requizzle.js +++ b/lib/requizzle.js @@ -40,13 +40,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; } /**