fix all imports for new structure

This commit is contained in:
jeffvli 2025-05-20 19:23:36 -07:00
parent 249eaf89f8
commit 930165d006
291 changed files with 2056 additions and 1894 deletions

View file

@ -11,7 +11,7 @@ const regex = /(url\("?)(?!data:)/gim;
const addStyles = (output: string[], styles: CSSStyleDeclaration) => {
for (let prop = styles.length - 1; prop >= 0; prop -= 1) {
const key = styles[prop] as keyof CSSStyleDeclaration;
const key = styles[prop] as string;
if (key !== 'content' && styles[key]) {
const value = styles[key];
const priority = styles.getPropertyPriority(key as string);
@ -75,7 +75,7 @@ DomPurify.addHook('afterSanitizeAttributes', (node: Element) => {
}
});
DomPurify.addHook('uponSanitizeElement', (node: Element) => {
(DomPurify as any).addHook('uponSanitizeElement', (node: Element) => {
if (node.tagName === 'STYLE') {
const rules = (node as HTMLStyleElement).sheet?.cssRules;
if (rules) {
@ -91,7 +91,7 @@ export const sanitize = (text: string): string => {
};
export const sanitizeCss = (text: string): string => {
return DomPurify.sanitize(text, {
return (DomPurify as any).sanitize(text, {
ALLOWED_ATTR: [],
ALLOWED_TAGS: ['style'],
RETURN_DOM: true,