Skip to content

Commit 24d52a2

Browse files
committed
Release 1.0.6
* fix(path-builder): fix #23. Build root path (#25) * fix(package.json): add npm keywords. fix #24 * 1.0.6 (#27)
1 parent a811455 commit 24d52a2

File tree

3 files changed

+19
-2
lines changed

3 files changed

+19
-2
lines changed

lib/routes-parser/path-builder.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ export default (baseRoute = '', route = '') => {
22
return (
33
`/${baseRoute}/${route}`
44
.replace(new RegExp('\/+', 'g'), '/')
5-
.replace(new RegExp('\/+$', 'g'), '')
5+
.replace(new RegExp('^.*?|\/$', 'g'), '')
66
);
77
};

package.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
{
22
"name": "react-router-sitemap",
3-
"version": "1.0.5",
3+
"version": "1.0.6",
44
"description": "Module to generate a sitemap for react-router configuration",
55
"repository": {
66
"type": "git",
77
"url": "https://github.com/kuflash/react-router-sitemap.git"
88
},
9+
"keywords": [
10+
"react",
11+
"react-router",
12+
"sitemap",
13+
"es2015"
14+
],
915
"main": "index.es5.js",
1016
"jsnext:main ": "index.js",
1117
"scripts": {

test/spec/router-parser/path-builder.spec.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,15 @@ describe('build path', () => {
2626

2727
});
2828

29+
it('return one slash', () => {
30+
31+
const baseRoute = '/';
32+
const route = '/';
33+
const etalon = '/';
34+
35+
expect(build(baseRoute)).toEqual(etalon);
36+
expect(build(baseRoute, route)).toEqual(etalon);
37+
38+
});
39+
2940
});

0 commit comments

Comments
 (0)