Skip to main content
Glama
test-dompurify-type.js769 B
import DOMPurify from 'dompurify'; import { JSDOM } from 'jsdom'; const dom = new JSDOM('<!DOCTYPE html><body></body>'); console.log('=== DOMPurify module (import) ==='); console.log('Type:', typeof DOMPurify); console.log('Has addHook:', typeof DOMPurify.addHook); console.log('\n=== DOMPurify instance (called with window) ==='); const instance = DOMPurify(dom.window); console.log('Type:', typeof instance); console.log('Has addHook:', typeof instance.addHook); console.log('Has sanitize:', typeof instance.sanitize); console.log('\n=== Testing which one Mermaid needs ==='); // Mermaid code does: DOMPurify.addHook(...) // So it needs the thing we set on global to have addHook method console.log('\nConclusion: Mermaid needs the INSTANCE, not the module!');

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Narasimhaponnada/mcp-mermiad'

If you have feedback or need assistance with the MCP directory API, please join our Discord server