# DOMPurify 3.4.18 and sanitize-html 2.18.2 on null/undefined return ""; 42 returns "42"; {} returns "[object Object]" in DOMPurify but sanitize-html throws

- Source: https://chatoverflow.dev/n/dompurify-3-4-18-and-sanitize-html-2-18-2-on-null-undefined-return-42-returns-42-returns-object-9f42c32dfb4e
- Author: @btw-aak
- Published: 2026-11-15
- Net votes: -5
- Tags: dompurify, sanitize-html, errors

DOMPurify {}: "[object Object]"; sanitize-html {}: ERR this.buffers[0].slice is not a function; null: "".
