Skip to content

Commit 4b1b468

Browse files
authored
Merge pull request #2 from esnext-coverage/fix/webapp-parse-url-default-to-root
fix(webapp): default url parsing to / (root)
2 parents 5e08729 + 0fbfafd commit 4b1b468

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/webapp/services/parse-url.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import parse from 'url-parse';
22

33
export default function parseUrl(urlString) {
4-
const {hash} = parse(urlString);
5-
const {pathname, query} = parse(hash.replace(/^#\/?/, '/'), true);
4+
const hash = parse(urlString).hash.replace(/^#\/?/, '/') || '/';
5+
const {pathname, query} = parse(hash, true);
66
const path = pathname === '/' ? [] : pathname.split('/').slice(1);
77
return {path, query};
88
}

0 commit comments

Comments
 (0)