MCPcopy Index your code
hub / github.com/angular-ui/ui-router / removeWindowsDriveName

Function removeWindowsDriveName

test/angular/1.4/angular.js:11895–11916  ·  view source on GitHub ↗
(path, url, base)

Source from the content-addressed store, hash-verified

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 /**

Callers 1

LocationHashbangUrlFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected