1.2.10 ā¢ Published 5 days ago
@jill64/universal-sanitizer v1.2.10
@jill64/universal-sanitizer
š Isomorphic html sanitizer by DOMPurify + sanitize-html
Installation
npm i @jill64/universal-sanitizer
Usage
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 |