Comparing version 3.0.5 to 3.1.0
var path = require('path'); // if module is locally defined we path.resolve it | ||
var appDir = path.dirname(require.main.filename); | ||
var find = require('find'); // https://www.npmjs.com/package/find | ||
@@ -29,7 +28,8 @@ | ||
var mod; | ||
if(moduleName.indexOf('.js') === -1) { | ||
mod = moduleName + '\.js'; // append .js to file type | ||
var ext = path.extname(moduleName); | ||
if(ext === '') { | ||
mod = moduleName + '\.js'; // append .js to file type by default | ||
} | ||
else { | ||
mod = moduleName.replace('.js', '\.js'); // escape .js for regex | ||
mod = moduleName.replace(ext, '\\' + ext); // escape extension for regex | ||
} | ||
@@ -36,0 +36,0 @@ |
{ | ||
"name": "decache", | ||
"version": "3.0.5", | ||
"version": "3.1.0", | ||
"description": "decache (Delete Cache) lets you delete modules from node.js require() cache; useful when testing your modules/projects.", | ||
@@ -5,0 +5,0 @@ "main": "decache.js", |
@@ -56,2 +56,4 @@ # decache | ||
Modules other than `.js`, like for example, `.jsx`, are supported as well. | ||
If you have any questions or need more examples, please create a GitHub issue: | ||
@@ -58,0 +60,0 @@ https://github.com/nelsonic/decache/issues |
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
11061
62