route-node
Advanced tools
Comparing version 0.1.2 to 0.1.3
@@ -74,3 +74,3 @@ define(['exports', 'module', 'path-parser'], function (exports, module, _pathParser) { | ||
if (!b.parser.hasUrlParams && a.parser.hasUrlParams) return 1; | ||
return 0; | ||
return a.path && b.path ? a.path.length < b.path.length : 0; | ||
}); | ||
@@ -77,0 +77,0 @@ } else { |
@@ -79,3 +79,3 @@ 'use strict'; | ||
if (!b.parser.hasUrlParams && a.parser.hasUrlParams) return 1; | ||
return 0; | ||
return a.path && b.path ? a.path.length < b.path.length : 0; | ||
}); | ||
@@ -82,0 +82,0 @@ } else { |
@@ -86,3 +86,3 @@ (function (global, factory) { | ||
if (!b.parser.hasUrlParams && a.parser.hasUrlParams) return 1; | ||
return 0; | ||
return a.path && b.path ? a.path.length < b.path.length : 0; | ||
}); | ||
@@ -89,0 +89,0 @@ } else { |
@@ -49,3 +49,3 @@ import Path from 'path-parser/modules/Path' | ||
if (!b.parser.hasUrlParams && a.parser.hasUrlParams) return 1 | ||
return 0; | ||
return a.path && b.path ? a.path.length < b.path.length : 0; | ||
}) | ||
@@ -52,0 +52,0 @@ } else { |
{ | ||
"name": "route-node", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"description": "A package to create a tree of named routes#", | ||
@@ -5,0 +5,0 @@ "main": "dist/commonjs/route-node.js", |
@@ -153,2 +153,13 @@ 'use strict'; | ||
}); | ||
it('should sort paths by length', function () { | ||
var rootNode = new RouteNode('', '') | ||
.addNode('index', '/') | ||
.addNode('abo', '/abo') | ||
.addNode('about', '/about'); | ||
rootNode.matchPath('/').should.eql({name: 'index', params: {}}); | ||
rootNode.matchPath('/abo').should.eql({name: 'abo', params: {}}); | ||
rootNode.matchPath('/about').should.eql({name: 'about', params: {}}); | ||
}); | ||
}); | ||
@@ -155,0 +166,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
45592
904