(path, url, base)
| 11893 | * do not include drive names for routing. |
| 11894 | */ |
| 11895 | function removeWindowsDriveName(path, url, base) { |
| 11896 | /* |
| 11897 | Matches paths for file protocol on windows, |
| 11898 | such as /C:/foo/bar, and captures only /foo/bar. |
| 11899 | */ |
| 11900 | var windowsFilePathExp = /^\/[A-Z]:(\/.*)/; |
| 11901 | |
| 11902 | var firstPathSegmentMatch; |
| 11903 | |
| 11904 | //Get the relative path from the input URL. |
| 11905 | if (url.indexOf(base) === 0) { |
| 11906 | url = url.replace(base, ''); |
| 11907 | } |
| 11908 | |
| 11909 | // The input URL intentionally contains a first path segment that ends with a colon. |
| 11910 | if (windowsFilePathExp.exec(url)) { |
| 11911 | return path; |
| 11912 | } |
| 11913 | |
| 11914 | firstPathSegmentMatch = windowsFilePathExp.exec(path); |
| 11915 | return firstPathSegmentMatch ? firstPathSegmentMatch[1] : path; |
| 11916 | } |
| 11917 | }; |
| 11918 | |
| 11919 | /** |
no outgoing calls
no test coverage detected