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

Function removeWindowsDriveName

lib/test/angular/1.7.0/angular.js:14046–14067  ·  view source on GitHub ↗
(path, url, base)

Source from the content-addressed store, hash-verified

14044 * do not include drive names for routing.
14045 */
14046 function removeWindowsDriveName(path, url, base) {
14047 /*
14048 Matches paths for file protocol on windows,
14049 such as /C:/foo/bar, and captures only /foo/bar.
14050 */
14051 var windowsFilePathExp = /^\/[A-Z]:(\/.*)/;
14052
14053 var firstPathSegmentMatch;
14054
14055 //Get the relative path from the input URL.
14056 if (startsWith(url, base)) {
14057 url = url.replace(base, '');
14058 }
14059
14060 // The input URL intentionally contains a first path segment that ends with a colon.
14061 if (windowsFilePathExp.exec(url)) {
14062 return path;
14063 }
14064
14065 firstPathSegmentMatch = windowsFilePathExp.exec(path);
14066 return firstPathSegmentMatch ? firstPathSegmentMatch[1] : path;
14067 }
14068 };
14069
14070 /**

Callers 1

LocationHashbangUrlFunction · 0.70

Calls 1

startsWithFunction · 0.70

Tested by

no test coverage detected