MCPcopy Create free account
hub / github.com/angular/angular / ɵɵsanitizeUrl

Function ɵɵsanitizeUrl

packages/core/src/sanitization/sanitization.ts:112–121  ·  view source on GitHub ↗
(unsafeUrl: any)

Source from the content-addressed store, hash-verified

110 * @codeGenApi
111 */
112export function ɵɵsanitizeUrl(unsafeUrl: any): string {
113 const sanitizer = getSanitizer();
114 if (sanitizer) {
115 return sanitizer.sanitize(SecurityContext.URL, unsafeUrl) || '';
116 }
117 if (allowSanitizationBypassAndThrow(unsafeUrl, BypassType.Url)) {
118 return unwrapSafeValue(unsafeUrl);
119 }
120 return _sanitizeUrl(renderStringify(unsafeUrl));
121}
122
123/**
124 * A `url` sanitizer which only lets trusted `url`s through.

Callers 1

Calls 6

unwrapSafeValueFunction · 0.90
_sanitizeUrlFunction · 0.90
renderStringifyFunction · 0.90
getSanitizerFunction · 0.85
sanitizeMethod · 0.45

Tested by

no test coverage detected