(value: string)
| 186 | } |
| 187 | |
| 188 | function escapeSelectorValue(value: string): string { |
| 189 | // Escape backslashes and double quotes to prevent CSS selector injection. |
| 190 | // This securely confines the value inside an attribute selector. |
| 191 | return `"${value.replace(/\\/g, '\\\\').replace(/"/g, '\\"')}"`; |
| 192 | } |
| 193 | |
| 194 | function containsAttributes(tag: MetaDefinition, elem: HTMLMetaElement): boolean { |
| 195 | return Object.keys(tag).every((key) => elem.getAttribute(getMetaKeyMap(key)) === tag[key]); |
no test coverage detected