Comparing version 0.1.1 to 0.1.2
@@ -67,3 +67,2 @@ | ||
if(token == '->') continue; | ||
@@ -132,2 +131,3 @@ | ||
expressions.push(parseRoutePaths(expr, routeTokens, j)); | ||
@@ -203,14 +203,30 @@ break; | ||
module.exports.stringifyThru = function(cthru) { | ||
var thru = []; | ||
while(cthru) { | ||
thru.push(module.exports.stringifySegments(cthru.path.segments)); | ||
cthru = cthru.thru; | ||
} | ||
module.exports.stringify = function(route) { | ||
return thru.reverse().join(" -> "); | ||
} | ||
module.exports.stringify = function(route, includeType) { | ||
var stringified = []; | ||
if(route.type) stringified.push(route.type); | ||
if(route.type && includeType !== false) stringified.push(route.type); | ||
stringified.push(module.exports.stringifyTags(route.tags)); | ||
stringified.push(module.exports.stringifySegments(route.path.segments)); | ||
var tags = module.exports.stringifyTags(route.tags), | ||
thru = module.exports.stringifyThru(route); | ||
if(tags.length) stringified.push(tags); | ||
stringified.push(thru); | ||
return stringified.join(' '); | ||
} |
{ | ||
"name": "crema", | ||
"description": "syntactic sugar for your javascript functions", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"repository": {}, | ||
@@ -6,0 +6,0 @@ "engines": {}, |
Sorry, the diff of this file is not supported yet
146
6401
8