express-enrouten
Advanced tools
Comparing version 1.2.1 to 1.2.2
@@ -0,1 +1,5 @@ | ||
##### v1.2.2 - 20160115 | ||
**Bugs** | ||
- Fix logic regarding requiring files with duplicate naming | ||
##### v0.2.1 - 20140210 | ||
@@ -2,0 +6,0 @@ **Bugs** |
@@ -97,8 +97,9 @@ 'use strict'; | ||
} | ||
if (ext !== '' && !isValidExtension(ext)) { | ||
return false; | ||
} | ||
try { | ||
// remove the file extension and use require.resolve to resolve known | ||
// file types eg. CoffeeScript. Will throw if not found/loadable by node. | ||
file = ext ? file.slice(0, -ext.length) : file; | ||
require.resolve(file); | ||
require(file); | ||
return true; | ||
@@ -109,1 +110,12 @@ } catch (err) { | ||
} | ||
/** | ||
* Returns true if `ext` is an extension with a registered handler | ||
* in module.extensions. | ||
* @param ext the file extension to check | ||
* @returns {boolean} | ||
*/ | ||
function isValidExtension(ext) { | ||
var keys = Object.keys(require.extensions); | ||
return keys.indexOf(ext) !== -1; | ||
} |
{ | ||
"name": "express-enrouten", | ||
"version": "1.2.1", | ||
"version": "1.2.2", | ||
"description": "An express route initialization and configuration module.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
27168
310
0