Comparing version 1.2.5 to 1.3.0
@@ -8,2 +8,3 @@ | ||
var compose = require('koa-compose'); | ||
var assert = require('assert'); | ||
@@ -33,3 +34,3 @@ /** | ||
if ('/' != prefix[0]) throw new Error('Mounted paths must begin with a /'); | ||
assert('/' == prefix[0], 'mount path must begin with "/"'); | ||
@@ -55,2 +56,3 @@ // compose | ||
this.mountPath = prefix; | ||
this.path = newPath; | ||
@@ -87,4 +89,6 @@ debug('enter %s -> %s', prev, this.path); | ||
if (0 != path.indexOf(prefix)) return false; | ||
var newPath = path.replace(prefix, '') || '/'; | ||
if (trailingSlash) return newPath; | ||
// `/mount` does not match `/mountlkjalskjdf` | ||
@@ -91,0 +95,0 @@ if ('/' != newPath[0]) return false; |
@@ -5,3 +5,3 @@ { | ||
"repository": "koajs/mount", | ||
"version": "1.2.5", | ||
"version": "1.3.0", | ||
"keywords": [ | ||
@@ -8,0 +8,0 @@ "koa", |
@@ -1,2 +0,1 @@ | ||
# koa-mount | ||
@@ -17,3 +16,3 @@ | ||
View the [./examples](blob/master/examples) directory for working examples. | ||
View the [./examples](examples) directory for working examples. | ||
@@ -129,2 +128,2 @@ ### Mounting Applications | ||
MIT | ||
MIT |
4835
75