Comparing version 0.1.0-beta-34 to 0.1.0-beta-35
@@ -25,2 +25,3 @@ "use strict"; | ||
routes: Type.ARRAY, | ||
createUrlRgx: Type.REGEX, | ||
config: Type.OBJECT | ||
@@ -30,2 +31,3 @@ }, { | ||
this.routes = []; | ||
this.createUrlRgx = /\/\//g; | ||
this.config = core.extend({ | ||
@@ -84,6 +86,17 @@ errorRoute: false, | ||
}, | ||
/** | ||
* @since 0.0.1 | ||
* @author Igor Ivanovic | ||
* @method Router#normalizeUrl | ||
* | ||
* @description | ||
* Create url | ||
* @return {string} | ||
*/ | ||
normalizeUrl: function Router_normalizeUrl(url) { | ||
return url.replace(this.createUrlRgx, '/').replace(this.createUrlRgx, '/'); | ||
}, | ||
/** | ||
* @since 0.0.1 | ||
* @author Igor Ivanovic | ||
* @method Router#createUrl | ||
@@ -121,3 +134,3 @@ * | ||
if (url) { | ||
return '/' + url + anchor; | ||
return this.normalizeUrl('/' + url + anchor); | ||
} | ||
@@ -131,3 +144,4 @@ } | ||
} | ||
return url + anchor; | ||
return this.normalizeUrl(url + anchor); | ||
}, | ||
@@ -134,0 +148,0 @@ /** |
@@ -5,3 +5,3 @@ { | ||
"description": "Powerful lightweight mvc framework for nodejs", | ||
"version": "0.1.0-beta-34", | ||
"version": "0.1.0-beta-35", | ||
"dependencies" : { | ||
@@ -8,0 +8,0 @@ "mongoose": "3.8.x", |
125897
4051