From 4cea4c2e3c7b4628288346d7c9c7d48621a087ae Mon Sep 17 00:00:00 2001 From: mherodev Date: Tue, 30 Oct 2018 00:30:11 -0700 Subject: [PATCH] Improved documentation slightly (#2825) --- packages/next-server/lib/router/router.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/next-server/lib/router/router.js b/packages/next-server/lib/router/router.js index 29a909a302374..31232ecf403d8 100644 --- a/packages/next-server/lib/router/router.js +++ b/packages/next-server/lib/router/router.js @@ -141,7 +141,7 @@ export default class Router { } async change (method, _url, _as, options) { - // If url and as provided as an object representation, + // If _url and _as provided as an object representation, // we'll format them into the string version here. const url = typeof _url === 'object' ? format(_url) : _url let as = typeof _as === 'object' ? format(_as) : _as @@ -431,5 +431,6 @@ export default class Router { } function toRoute (path) { + // remove trailing slash, except for root path return path.replace(/\/$/, '') || '/' }