(elementName: string, fatal: boolean = true)
| 985 | } |
| 986 | |
| 987 | function splitNsName(elementName: string, fatal: boolean = true): [string | null, string] { |
| 988 | if (elementName[0] != ':') { |
| 989 | return [null, elementName]; |
| 990 | } |
| 991 | |
| 992 | const colonIndex = elementName.indexOf(':', 1); |
| 993 | |
| 994 | if (colonIndex === -1) { |
| 995 | if (fatal) { |
| 996 | throw new Error(`Unsupported format "${elementName}" expecting ":namespace:name"`); |
| 997 | } else { |
| 998 | return [null, elementName]; |
| 999 | } |
| 1000 | } |
| 1001 | |
| 1002 | return [elementName.slice(1, colonIndex), elementName.slice(colonIndex + 1)]; |
| 1003 | } |
| 1004 | |
| 1005 | function i18nResolveSanitizer(attrName: string, tagName?: string): SanitizerFn | null { |
| 1006 | let schemaContext: SecurityContext; |
no test coverage detected
searching dependent graphs…