Comparing version 0.0.3 to 0.0.4
@@ -5,3 +5,3 @@ | ||
var lastDate | ||
, namespaces = {} | ||
, namespaces = createDebug.namespaces = {} | ||
, filters = [] | ||
@@ -8,0 +8,0 @@ , lastLog = {} |
22
index.js
@@ -11,11 +11,13 @@ | ||
app.use = function appUse(fn) { | ||
uses.push(fn) | ||
app.use = function appUse(path, fn) { | ||
if (typeof path !== "string") { | ||
fn = path | ||
path = null | ||
} | ||
if (fn) { | ||
uses.push(path, fn) | ||
} | ||
return app | ||
} | ||
app.param = function appParam(req, res, next, id) { | ||
return app | ||
} | ||
return app | ||
@@ -27,3 +29,9 @@ | ||
function next(err) { | ||
;(uses[usePos++] || end)(req, res, next, options) | ||
var path = uses[usePos++] | ||
if (path && path !== req.url.slice(0, path.length)) { | ||
usePos++ | ||
next() | ||
} else { | ||
;(uses[usePos++] || end)(req, res, next, options) | ||
} | ||
} | ||
@@ -30,0 +38,0 @@ next() |
{ | ||
"name": "app-lite", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"stability": 1, | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -58,13 +58,1 @@ | ||
function wait(fn) { | ||
var pending = 1 | ||
function resume() { | ||
if (!--pending && fn) fn.call(this) | ||
} | ||
resume.wait = function() { | ||
pending++ | ||
return resume | ||
} | ||
return resume | ||
} | ||
20841
11
660