find-my-way
Advanced tools
Comparing version 7.6.1 to 7.6.2
@@ -564,2 +564,3 @@ 'use strict' | ||
let tree = null | ||
if (method === undefined) { | ||
@@ -578,7 +579,8 @@ const { version, host, ...constraints } = this.constrainer.strategies | ||
mergedRouter._rebuild(mergedRoutes) | ||
return prettyPrintTree(mergedRouter.trees.MERGED, options) | ||
tree = mergedRouter.trees.MERGED | ||
} else { | ||
tree = this.trees[method] | ||
} | ||
const tree = this.trees[method] | ||
if (tree == null) return '(empty tree)' | ||
return prettyPrintTree(tree, options) | ||
@@ -585,0 +587,0 @@ } |
{ | ||
"name": "find-my-way", | ||
"version": "7.6.1", | ||
"version": "7.6.2", | ||
"description": "Crazy fast http radix based router", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -7,2 +7,13 @@ 'use strict' | ||
test('pretty print - empty tree', t => { | ||
t.plan(2) | ||
const findMyWay = FindMyWay() | ||
const tree = findMyWay.prettyPrint({ method: 'GET' }) | ||
const expected = '(empty tree)' | ||
t.equal(typeof tree, 'string') | ||
t.equal(tree, expected) | ||
}) | ||
test('pretty print - static routes', t => { | ||
@@ -9,0 +20,0 @@ t.plan(2) |
@@ -7,2 +7,13 @@ 'use strict' | ||
test('pretty print - empty tree', t => { | ||
t.plan(2) | ||
const findMyWay = FindMyWay() | ||
const tree = findMyWay.prettyPrint() | ||
const expected = '(empty tree)' | ||
t.equal(typeof tree, 'string') | ||
t.equal(tree, expected) | ||
}) | ||
test('pretty print - static routes', t => { | ||
@@ -9,0 +20,0 @@ t.plan(2) |
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
353661
8845