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

Function removeWindowsDriveName

lib/test/angular/1.8.0/angular.js:14686–14707  ·  view source on GitHub ↗
(path, url, base)

Source from the content-addressed store, hash-verified

14684 * do not include drive names for routing.
14685 */
14686 function removeWindowsDriveName(path, url, base) {
14687 /*
14688 Matches paths for file protocol on windows,
14689 such as /C:/foo/bar, and captures only /foo/bar.
14690 */
14691 var windowsFilePathExp = /^\/[A-Z]:(\/.*)/;
14692
14693 var firstPathSegmentMatch;
14694
14695 //Get the relative path from the input URL.
14696 if (startsWith(url, base)) {
14697 url = url.replace(base, '');
14698 }
14699
14700 // The input URL intentionally contains a first path segment that ends with a colon.
14701 if (windowsFilePathExp.exec(url)) {
14702 return path;
14703 }
14704
14705 firstPathSegmentMatch = windowsFilePathExp.exec(path);
14706 return firstPathSegmentMatch ? firstPathSegmentMatch[1] : path;
14707 }
14708 };
14709
14710 this.$$normalizeUrl = function(url) {

Callers 1

LocationHashbangUrlFunction · 0.70

Calls 1

startsWithFunction · 0.70

Tested by

no test coverage detected