swagger-router
Advanced tools
Comparing version 0.6.0 to 0.7.0
@@ -94,9 +94,11 @@ "use strict"; | ||
* parameters encountered during the lookup process. | ||
* @param {bool} exact, whether to do an exact segment lookup | ||
* (where * and ** only match themselves) | ||
* @return {null|Node} | ||
*/ | ||
getChild(segment, params) { | ||
getChild(segment, params, exact) { | ||
if (segment.constructor === String) { | ||
// Fast path | ||
let res = this._children[_keyPrefix + segment]; | ||
if (!res) { | ||
if (!res && !exact) { | ||
// Fall back to the wildcard match. | ||
@@ -132,3 +134,3 @@ res = this._children['*']; | ||
// Unwrap the pattern | ||
return this.getChild(segment.pattern, params); | ||
return this.getChild(segment.pattern, params, exact); | ||
} else if (this._children['*'] | ||
@@ -135,0 +137,0 @@ && this._children['*']._paramName === segment.name) { |
{ | ||
"name": "swagger-router", | ||
"version": "0.6.0", | ||
"version": "0.7.0", | ||
"description": "An efficient swagger 2 based router with support for multiple APIs. For use in RESTBase.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
85226
2229