express-enrouten
Advanced tools
Comparing version 1.0.0 to 1.1.0
30
index.js
@@ -64,17 +64,25 @@ /*───────────────────────────────────────────────────────────────────────────*\ | ||
// Setup app locals for use in handlers. | ||
parent.locals.enrouten = { | ||
// Do this way because app.locals has no prototype. One question this raises is, | ||
// should an app be able to use enrouten multiple times, and if so, should | ||
// app.locals.enrouten routes be merged? | ||
// https://github.com/visionmedia/express/blob/6775658ed5cbac13f2d24c89e23ed967ad6a66ba/lib/application.js#L68 | ||
if (!Object.prototype.hasOwnProperty.call(parent.locals, 'enrouten')) { | ||
Object.defineProperty(parent.locals, 'enrouten', { | ||
value: { | ||
routes: router.routes, | ||
routes: router.routes, | ||
path: function path(name, data) { | ||
var route; | ||
route = this.routes[name]; | ||
if (typeof route === 'string') { | ||
return reverend(route, data || {}); | ||
path: function path(name, data) { | ||
var route; | ||
route = this.routes[name]; | ||
if (typeof route === 'string') { | ||
return reverend(route, data || {}); | ||
} | ||
return undefined; | ||
} | ||
} | ||
return undefined; | ||
} | ||
}); | ||
} | ||
}; | ||
debug('mounting routes at', app.mountpath); | ||
@@ -81,0 +89,0 @@ debug(router.routes); |
@@ -90,2 +90,9 @@ 'use strict'; | ||
// Omit dotfiles | ||
// NOTE: Temporary fix in lieu of more complete (cross platform) | ||
// fix using file flags/attributes. | ||
if (path.basename(file, ext)[0] === '.') { | ||
return false; | ||
} | ||
try { | ||
@@ -92,0 +99,0 @@ // remove the file extension and use require.resolve to resolve known |
{ | ||
"name": "express-enrouten", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "An express route initialization and configuration module.", | ||
@@ -30,13 +30,13 @@ "main": "index.js", | ||
"devDependencies": { | ||
"express": "~4.0.0", | ||
"supertest": "~0.8.2", | ||
"tape": "~2.10.2", | ||
"istanbul": "~0.2.6", | ||
"jshint": "~2.4.4" | ||
"express": "^4.0.0", | ||
"istanbul": "^0.2.11", | ||
"jshint": "^2.5.1", | ||
"supertest": "^0.13.0", | ||
"tape": "^2.13.3" | ||
}, | ||
"dependencies": { | ||
"caller": "~0.0.1", | ||
"debuglog": "~1.0.1", | ||
"reverend": "~0.2.0" | ||
"caller": "0.0.1", | ||
"debuglog": "^1.0.1", | ||
"reverend": "^0.2.0" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
198055
409
0
Updatedcaller@0.0.1
Updateddebuglog@^1.0.1
Updatedreverend@^0.2.0