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

Function removeWindowsDriveName

test/angular/1.2/angular.js:9458–9479  ·  view source on GitHub ↗
(path, url, base)

Source from the content-addressed store, hash-verified

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

Callers 1

LocationHashbangUrlFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected