(input)
| 21954 | return href.slice("https://foo.com/".length); |
| 21955 | } |
| 21956 | function normalizePath(input) { |
| 21957 | if (!parentRegex.test(input)) |
| 21958 | return normalizeSimplePath(input); |
| 21959 | let total = 1; |
| 21960 | while (parentRegex.test(input)) |
| 21961 | total++; |
| 21962 | const uniqDirectory = `z${uniqInStr(input)}/`; |
| 21963 | const search = new RegExp(`^(?:${uniqDirectory})*`); |
| 21964 | const relative = normalizeSimplePath(uniqDirectory.repeat(total) + input); |
| 21965 | return relative.replace(search, (all) => { |
| 21966 | const leftover = all.length / uniqDirectory.length; |
| 21967 | return "../".repeat(total - leftover); |
| 21968 | }); |
| 21969 | } |
| 21970 | function resolve(input, base) { |
| 21971 | if (!base) |
| 21972 | base = ""; |
no test coverage detected