require-in-the-middle
Advanced tools
Comparing version 5.0.2 to 5.0.3
12
index.js
@@ -11,2 +11,12 @@ 'use strict' | ||
const builtins = Module.builtinModules | ||
const isCore = builtins | ||
? (filename) => builtins.includes(filename) | ||
// Fallback in case `builtins` isn't available in the current Node.js | ||
// version. This isn't as acurate, as some core modules contain slashes, but | ||
// all modern versions of Node.js supports `buildins`, so it shouldn't affect | ||
// many people. | ||
: (filename) => filename.includes(path.sep) === false | ||
// 'foo/bar.js' or 'foo/bar/index.js' => 'foo/bar' | ||
@@ -53,3 +63,3 @@ const normalize = /([/\\]index)?(\.js)?$/ | ||
const filename = Module._resolveFilename(id, this) | ||
const core = filename.includes(path.sep) === false | ||
const core = isCore(filename) | ||
let moduleName, basedir | ||
@@ -56,0 +66,0 @@ |
{ | ||
"name": "require-in-the-middle", | ||
"version": "5.0.2", | ||
"version": "5.0.3", | ||
"description": "Module to hook into the Node.js require function", | ||
@@ -15,2 +15,3 @@ "main": "index.js", | ||
"roundround": "^0.2.0", | ||
"semver": "^6.3.0", | ||
"standard": "^14.3.1", | ||
@@ -45,5 +46,5 @@ "tape": "^4.11.0" | ||
"coordinates": [ | ||
55.776571, | ||
12.592961 | ||
56.009779, | ||
11.962099 | ||
] | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
11279
142
6