(path, url, base)
| 12321 | * do not include drive names for routing. |
| 12322 | */ |
| 12323 | function removeWindowsDriveName(path, url, base) { |
| 12324 | /* |
| 12325 | Matches paths for file protocol on windows, |
| 12326 | such as /C:/foo/bar, and captures only /foo/bar. |
| 12327 | */ |
| 12328 | var windowsFilePathExp = /^\/[A-Z]:(\/.*)/; |
| 12329 | |
| 12330 | var firstPathSegmentMatch; |
| 12331 | |
| 12332 | //Get the relative path from the input URL. |
| 12333 | if (url.indexOf(base) === 0) { |
| 12334 | url = url.replace(base, ''); |
| 12335 | } |
| 12336 | |
| 12337 | // The input URL intentionally contains a first path segment that ends with a colon. |
| 12338 | if (windowsFilePathExp.exec(url)) { |
| 12339 | return path; |
| 12340 | } |
| 12341 | |
| 12342 | firstPathSegmentMatch = windowsFilePathExp.exec(path); |
| 12343 | return firstPathSegmentMatch ? firstPathSegmentMatch[1] : path; |
| 12344 | } |
| 12345 | }; |
| 12346 | |
| 12347 | /** |
no outgoing calls
no test coverage detected