(originalUrl: string)
| 161 | * standard `url` property making it impossible to get the true depth. |
| 162 | */ |
| 163 | export const relativeRoot = (originalUrl: string): string => { |
| 164 | const depth = (originalUrl.split("?", 1)[0].match(/\//g) || []).length |
| 165 | return normalize("./" + (depth > 1 ? "../".repeat(depth - 1) : "")) |
| 166 | } |
| 167 | |
| 168 | /** |
| 169 | * A helper function to construct a redirect path based on |
no test coverage detected