Correctly handle trailing slashes in paths of routes
If you are using trailing slashes in your paths, then the router will match urls only with trailing slashes:
const routes = [
{ path: '/posts', ... }, // matches both "/posts" and "/posts/"
{ path: '/posts/', ... }, // matches only "/posts/"
];
Generate url from first path for routes with an array of paths
const router = new UniversalRouter({
name: 'page',
path: ['/one', '/two', /RegExp/], // only first path is used for url generation
});
const url = generateUrls(router);
url('page'); // => /one
Coverage remained the same at 100.0% when pulling 71fcb699242c599e666728b05dbe2ca8f559a8e8 on frenzzy:trailing-slashes into 975a375ee52aa21406e3cd6778b06053e7e6c5f6 on kriasoft:master.
Coverage remained the same at 100.0% when pulling d9985fec6875a8f8a1ebb75a21a17bd5f42c3b57 on frenzzy:trailing-slashes into 975a375ee52aa21406e3cd6778b06053e7e6c5f6 on kriasoft:master.
Generate url from first path for routes with an array of paths