(value: string)
| 118 | } |
| 119 | |
| 120 | function stripQueryAndHash(value: string): string { |
| 121 | const hashIdx = value.indexOf('#') |
| 122 | const queryIdx = value.indexOf('?') |
| 123 | const cutIdx = |
| 124 | hashIdx === -1 |
| 125 | ? queryIdx |
| 126 | : queryIdx === -1 |
| 127 | ? hashIdx |
| 128 | : Math.min(hashIdx, queryIdx) |
| 129 | return cutIdx === -1 ? value : value.slice(0, cutIdx) |
| 130 | } |
| 131 | |
| 132 | function decodeHrefPath(value: string): string { |
| 133 | const cleaned = stripQueryAndHash(value) |