Comparing version 1.2.1 to 1.2.2
41
index.js
@@ -35,27 +35,26 @@ | ||
return function(upstream){ | ||
return function *(upstream){ | ||
var prev = this.path; | ||
// compose | ||
var downstream = app.middleware | ||
? compose(app.middleware) | ||
: app; | ||
return function *(){ | ||
var prev = this.path; | ||
// not a match | ||
if (0 != this.url.indexOf(path)) return yield upstream; | ||
// strip the path prefix | ||
var newPath = replace(this.path, path); | ||
// not a match | ||
if (0 != this.url.indexOf(path)) return yield upstream; | ||
// strip the path prefix | ||
var newPath = replace(this.path, path); | ||
this.path = newPath; | ||
debug('enter %s -> %s', prev, this.path); | ||
yield downstream.call(this, function *(){ | ||
this.path = prev; | ||
yield upstream; | ||
this.path = newPath; | ||
debug('enter %s -> %s', prev, this.path); | ||
yield downstream.call(this, function *(){ | ||
this.path = prev; | ||
yield upstream; | ||
this.path = newPath; | ||
}.call(this)); | ||
debug('leave %s -> %s', prev, this.path); | ||
this.path = prev; | ||
} | ||
}.call(this)); | ||
debug('leave %s -> %s', prev, this.path); | ||
this.path = prev; | ||
} | ||
@@ -62,0 +61,0 @@ } |
@@ -5,3 +5,3 @@ { | ||
"repository": "koajs/mount", | ||
"version": "1.2.1", | ||
"version": "1.2.2", | ||
"keywords": [ | ||
@@ -24,5 +24,5 @@ "koa", | ||
"dependencies": { | ||
"koa-compose": "2.0.0", | ||
"koa-compose": "~2.1.0", | ||
"debug": "*" | ||
} | ||
} |
4144
59
+ Addedkoa-compose@2.1.0(transitive)
- Removedkoa-compose@2.0.0(transitive)
Updatedkoa-compose@~2.1.0