π Isomorphic html sanitizer by DOMPurify + sanitize-html
npm i @jill64/universal-sanitizer
Conditional Export applies the appropriate file at each runtime.
import { sanitize } from '@jill64/universal-sanitizer'
const cleaned = sanitize(/* ... */, {
// options: {
// sanitizeHtml: sanitize-html options
// dompurify: DOMPurify options
// }
})
condition | resolve |
---|---|
browser |
DOMPurify |
default |
sanitize-html |
worker |
sanitize-html |