require-in-the-middle
Advanced tools
Comparing version 1.0.0 to 2.0.0
12
index.js
@@ -16,8 +16,5 @@ 'use strict' | ||
Module._load = function (request, parent, isMain) { | ||
var filename = Module._resolveFilename(request, parent) | ||
var cached = Module._cache[filename] | ||
var exports = orig.apply(Module, arguments) | ||
if (cached) return exports // abort if module is already cached by core | ||
var filename = Module._resolveFilename(request, parent) | ||
var native = filename.indexOf(path.sep) === -1 | ||
@@ -34,2 +31,3 @@ var name, basedir | ||
// figure out if this is the main module file, or a file inside the module | ||
var res = resolve.sync(name, { basedir: basedir }) | ||
@@ -39,10 +37,10 @@ if (res !== filename) return exports // abort if not main module file | ||
if (patched[basedir || name]) return exports // abort if module have already been processed | ||
patched[basedir || name] = true | ||
// abort if module name isn't on whitelist | ||
if (modules && modules.indexOf(name) === -1) return exports | ||
if (patched[filename]) return exports // abort if module have already been processed | ||
patched[filename] = true | ||
return onrequire(exports, name, basedir) | ||
} | ||
} |
{ | ||
"name": "require-in-the-middle", | ||
"version": "1.0.0", | ||
"version": "2.0.0", | ||
"description": "Module to hook into the Node.js require function", | ||
@@ -43,5 +43,5 @@ "main": "index.js", | ||
"coordinates": [ | ||
55.6665824, | ||
12.5800815 | ||
55.6665852, | ||
12.5800842 | ||
] | ||
} |
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
5235
81