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

Function removeWindowsDriveName

test/angular/1.7/angular.js:14621–14642  ·  view source on GitHub ↗
(path, url, base)

Source from the content-addressed store, hash-verified

14619 * do not include drive names for routing.
14620 */
14621 function removeWindowsDriveName(path, url, base) {
14622 /*
14623 Matches paths for file protocol on windows,
14624 such as /C:/foo/bar, and captures only /foo/bar.
14625 */
14626 var windowsFilePathExp = /^\/[A-Z]:(\/.*)/;
14627
14628 var firstPathSegmentMatch;
14629
14630 //Get the relative path from the input URL.
14631 if (startsWith(url, base)) {
14632 url = url.replace(base, '');
14633 }
14634
14635 // The input URL intentionally contains a first path segment that ends with a colon.
14636 if (windowsFilePathExp.exec(url)) {
14637 return path;
14638 }
14639
14640 firstPathSegmentMatch = windowsFilePathExp.exec(path);
14641 return firstPathSegmentMatch ? firstPathSegmentMatch[1] : path;
14642 }
14643 };
14644
14645 this.$$normalizeUrl = function(url) {

Callers 1

LocationHashbangUrlFunction · 0.70

Calls 1

startsWithFunction · 0.70

Tested by

no test coverage detected