Comparing version 0.6.0 to 0.6.1
@@ -1,7 +0,10 @@ | ||
var Param = function(item) { | ||
this.item = item; | ||
var param = function(val) { | ||
return function(map) { | ||
return map[val]; | ||
}; | ||
}; | ||
Param.prototype.toString = function(params) { | ||
return params[this.item]; | ||
var str = function(val) { | ||
return function() { | ||
return val; | ||
}; | ||
}; | ||
@@ -14,10 +17,10 @@ | ||
format = format.match(/(?:[^\{]+)|(?:{[^\}]+\})/g).map(function(item) { | ||
return item[0] !== '{' ? item : new Param(item.substring(1, item.length-1)); | ||
return item[0] !== '{' ? str(item) : param(item.substring(1, item.length-1)); | ||
}); | ||
return function(params) { | ||
return format.reduce(function(item, result) { | ||
return result+item.toString(params); | ||
return format.reduce(function(result, item) { | ||
return result+item(params); | ||
}, ''); | ||
}; | ||
}; |
{ | ||
"name":"router", | ||
"version":"0.6.0", | ||
"version":"0.6.1", | ||
"description":"A lean and mean http router", | ||
@@ -5,0 +5,0 @@ "keywords":["connect","middleware","router","route","http"], |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
13927
381
1