(url: string, baseHref: string, literalQuestionMark?: boolean)
| 173 | } |
| 174 | |
| 175 | function urlToRegex(url: string, baseHref: string, literalQuestionMark?: boolean): string { |
| 176 | if (!url.startsWith('/') && url.indexOf('://') === -1) { |
| 177 | // Prefix relative URLs with `baseHref`. |
| 178 | // Strip a leading `.` from a relative `baseHref` (e.g. `./foo/`), since it would result in an |
| 179 | // incorrect regex (matching a literal `.`). |
| 180 | url = joinUrls(baseHref.replace(/^\.(?=\/)/, ''), url); |
| 181 | } |
| 182 | |
| 183 | return globToRegex(url, literalQuestionMark); |
| 184 | } |
| 185 | |
| 186 | function joinUrls(a: string, b: string): string { |
| 187 | if (a.endsWith('/') && b.startsWith('/')) { |
no test coverage detected
searching dependent graphs…