(path, url, base)
| 9456 | * do not include drive names for routing. |
| 9457 | */ |
| 9458 | function removeWindowsDriveName (path, url, base) { |
| 9459 | /* |
| 9460 | Matches paths for file protocol on windows, |
| 9461 | such as /C:/foo/bar, and captures only /foo/bar. |
| 9462 | */ |
| 9463 | var windowsFilePathExp = /^\/[A-Z]:(\/.*)/; |
| 9464 | |
| 9465 | var firstPathSegmentMatch; |
| 9466 | |
| 9467 | //Get the relative path from the input URL. |
| 9468 | if (url.indexOf(base) === 0) { |
| 9469 | url = url.replace(base, ''); |
| 9470 | } |
| 9471 | |
| 9472 | // The input URL intentionally contains a first path segment that ends with a colon. |
| 9473 | if (windowsFilePathExp.exec(url)) { |
| 9474 | return path; |
| 9475 | } |
| 9476 | |
| 9477 | firstPathSegmentMatch = windowsFilePathExp.exec(path); |
| 9478 | return firstPathSegmentMatch ? firstPathSegmentMatch[1] : path; |
| 9479 | } |
| 9480 | }; |
| 9481 | |
| 9482 | /** |
no outgoing calls
no test coverage detected