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

Function removeWindowsDriveName

lib/test/angular/1.6.7/angular.js:13842–13863  ·  view source on GitHub ↗
(path, url, base)

Source from the content-addressed store, hash-verified

13840 * do not include drive names for routing.
13841 */
13842 function removeWindowsDriveName(path, url, base) {
13843 /*
13844 Matches paths for file protocol on windows,
13845 such as /C:/foo/bar, and captures only /foo/bar.
13846 */
13847 var windowsFilePathExp = /^\/[A-Z]:(\/.*)/;
13848
13849 var firstPathSegmentMatch;
13850
13851 //Get the relative path from the input URL.
13852 if (startsWith(url, base)) {
13853 url = url.replace(base, '');
13854 }
13855
13856 // The input URL intentionally contains a first path segment that ends with a colon.
13857 if (windowsFilePathExp.exec(url)) {
13858 return path;
13859 }
13860
13861 firstPathSegmentMatch = windowsFilePathExp.exec(path);
13862 return firstPathSegmentMatch ? firstPathSegmentMatch[1] : path;
13863 }
13864 };
13865
13866 /**

Callers 1

LocationHashbangUrlFunction · 0.70

Calls 1

startsWithFunction · 0.70

Tested by

no test coverage detected