(value: string)
| 204 | } |
| 205 | |
| 206 | function escapeSelectorValue(value: string): string { |
| 207 | // Escape backslashes and double quotes to prevent CSS selector injection. |
| 208 | // This securely confines the value inside an attribute selector. |
| 209 | return `"${value.replace(/\\/g, '\\\\').replace(/"/g, '\\"')}"`; |
| 210 | } |
| 211 | |
| 212 | function containsAttributes(tag: MetaDefinition, elem: HTMLMetaElement): boolean { |
| 213 | return Object.keys(tag).every((key) => elem.getAttribute(getMetaKeyMap(key)) === tag[key]); |
no test coverage detected