Skip to content

Commit

Permalink
Release 1.0.6
Browse files Browse the repository at this point in the history
* fix(path-builder): fix #23. Build root path (#25)

* fix(package.json): add npm keywords. fix #24

* 1.0.6 (#27)
  • Loading branch information
kuflash committed Jun 8, 2016
1 parent a811455 commit 24d52a2
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/routes-parser/path-builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ export default (baseRoute = '', route = '') => {
return (
`/${baseRoute}/${route}`
.replace(new RegExp('\/+', 'g'), '/')
.replace(new RegExp('\/+$', 'g'), '')
.replace(new RegExp('^.*?|\/$', 'g'), '')
);
};
8 changes: 7 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
{
"name": "react-router-sitemap",
"version": "1.0.5",
"version": "1.0.6",
"description": "Module to generate a sitemap for react-router configuration",
"repository": {
"type": "git",
"url": "https://github.com/kuflash/react-router-sitemap.git"
},
"keywords": [
"react",
"react-router",
"sitemap",
"es2015"
],
"main": "index.es5.js",
"jsnext:main ": "index.js",
"scripts": {
Expand Down
11 changes: 11 additions & 0 deletions test/spec/router-parser/path-builder.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,15 @@ describe('build path', () => {

});

it('return one slash', () => {

const baseRoute = '/';
const route = '/';
const etalon = '/';

expect(build(baseRoute)).toEqual(etalon);
expect(build(baseRoute, route)).toEqual(etalon);

});

});

0 comments on commit 24d52a2

Please sign in to comment.