Skip to content

Commit

Permalink
избавление от лишних слешей вначале path (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
KefirNot authored and olegman committed May 4, 2018
1 parent aae97db commit b189d87
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/browser-router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ export default class BrowserRouter extends Router {
}
}
static async init(opts: initParams): Promise<initResult> {
opts.path = opts.history.location.pathname + opts.history.location.search + opts.history.location.hash;
const { pathname, search, hash } = opts.history.location;
opts.path = `${pathname}${search}${hash}`.replace(/^(\/)+/, '/');
const result = await super.init(opts);
return {
...result,
Expand Down

0 comments on commit b189d87

Please sign in to comment.