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

Function urlResolve

lib/test/angular/1.7.0/angular.js:21000–21027  ·  view source on GitHub ↗

* * Implementation Notes for non-IE browsers * ---------------------------------------- * Assigning a URL to the href property of an anchor DOM node, even one attached to the DOM, * results both in the normalizing and parsing of the URL. Normalizing means that a relative * URL will be resolved

(url)

Source from the content-addressed store, hash-verified

20998 *
20999 */
21000function urlResolve(url) {
21001 if (!isString(url)) return url;
21002
21003 var href = url;
21004
21005 // Support: IE 9-11 only
21006 if (msie) {
21007 // Normalize before parse. Refer Implementation Notes on why this is
21008 // done in two steps on IE.
21009 urlParsingNode.setAttribute('href', href);
21010 href = urlParsingNode.href;
21011 }
21012
21013 urlParsingNode.setAttribute('href', href);
21014
21015 return {
21016 href: urlParsingNode.href,
21017 protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',
21018 host: urlParsingNode.host,
21019 search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '',
21020 hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',
21021 hostname: urlParsingNode.hostname,
21022 port: urlParsingNode.port,
21023 pathname: (urlParsingNode.pathname.charAt(0) === '/')
21024 ? urlParsingNode.pathname
21025 : '/' + urlParsingNode.pathname
21026 };
21027}
21028
21029/**
21030 * Parse a request URL and determine whether this is a same-origin request as the application

Callers 9

createHttpBackendFunction · 0.70
parseAbsoluteUrlFunction · 0.70
parseAppUrlFunction · 0.70
$LocationProviderFunction · 0.70
$$SanitizeUriProviderFunction · 0.70
angular.jsFile · 0.70
urlsAreSameOriginFunction · 0.70

Calls 1

isStringFunction · 0.70

Tested by

no test coverage detected