* Parse the url * @param {string} [path=location.herf] URL to be parsed * @return {object} { path, query }
(path = location.href)
| 78 | * @return {object} { path, query } |
| 79 | */ |
| 80 | parse(path = location.href) { |
| 81 | let query = ''; |
| 82 | |
| 83 | const hashIndex = path.indexOf('#'); |
| 84 | if (hashIndex >= 0) { |
| 85 | path = path.slice(hashIndex + 1); |
| 86 | } |
| 87 | |
| 88 | const queryIndex = path.indexOf('?'); |
| 89 | if (queryIndex >= 0) { |
| 90 | query = path.slice(queryIndex + 1); |
| 91 | path = path.slice(0, queryIndex); |
| 92 | } |
| 93 | |
| 94 | return { |
| 95 | path, |
| 96 | file: this.getFile(path, true), |
| 97 | query: parseQuery(query), |
| 98 | }; |
| 99 | } |
| 100 | |
| 101 | toURL(path, params, currentRoute) { |
| 102 | return '#' + super.toURL(path, params, currentRoute); |
nothing calls this directly
no test coverage detected