1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
| export function parsePath (path) {
| let hash = ''
| let query = ''
|
| const hashIndex = path.indexOf('#')
| if (hashIndex >= 0) {
| hash = path.slice(hashIndex)
| path = path.slice(0, hashIndex)
| }
|
| const queryIndex = path.indexOf('?')
| if (queryIndex >= 0) {
| query = path.slice(queryIndex + 1)
| path = path.slice(0, queryIndex)
| }
|
| return {
| path,
| query,
| hash
| }
| }
|
|