MCPcopy Index your code
hub / github.com/angular/angular / i18nResolveSanitizer

Function i18nResolveSanitizer

packages/core/src/render3/i18n/i18n_parse.ts:1005–1031  ·  view source on GitHub ↗
(attrName: string, tagName?: string)

Source from the content-addressed store, hash-verified

1003}
1004
1005function i18nResolveSanitizer(attrName: string, tagName?: string): SanitizerFn | null {
1006 let schemaContext: SecurityContext;
1007
1008 if (tagName) {
1009 const [ns, name] = splitNsName(tagName, false);
1010 schemaContext = checkSecurityContext(name, attrName, ns);
1011 } else {
1012 schemaContext = checkSecurityContext('*', attrName);
1013 }
1014
1015 switch (schemaContext) {
1016 case SecurityContext.HTML:
1017 return _sanitizeHtml;
1018 case SecurityContext.STYLE:
1019 return _sanitizeStyle;
1020 case SecurityContext.SCRIPT:
1021 return _sanitizeScript;
1022 case SecurityContext.URL:
1023 return _sanitizeUrl;
1024 case SecurityContext.RESOURCE_URL:
1025 return _sanitizeResourceUrl;
1026 case SecurityContext.ATTRIBUTE_NO_BINDING:
1027 return _validateAttribute;
1028 default:
1029 return null;
1030 }
1031}

Callers 2

i18nAttributesFirstPassFunction · 0.85
walkIcuTreeFunction · 0.85

Calls 2

checkSecurityContextFunction · 0.90
splitNsNameFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…