(url: string)
| 17 | } |
| 18 | |
| 19 | function splitUrl(url: string): { |
| 20 | path: string |
| 21 | query: string |
| 22 | fragment: string |
| 23 | } { |
| 24 | const hashIdx = url.indexOf('#') |
| 25 | const fragment = hashIdx === -1 ? '' : url.slice(hashIdx) |
| 26 | const beforeHash = hashIdx === -1 ? url : url.slice(0, hashIdx) |
| 27 | const qIdx = beforeHash.indexOf('?') |
| 28 | const path = qIdx === -1 ? beforeHash : beforeHash.slice(0, qIdx) |
| 29 | const query = qIdx === -1 ? '' : beforeHash.slice(qIdx + 1) |
| 30 | return { path, query, fragment } |
| 31 | } |
| 32 | |
| 33 | function buildQueryString(query: HttpRequestDraft['query']): string { |
| 34 | return query |
no outgoing calls
no test coverage detected