import {FilterXSS} from 'xss'; const filter = new FilterXSS({ whiteList: {}, // Filter all tags. stripIgnoreTag: true, // Filter all HTML not in the whitelist. stripIgnoreTagBody: ['script'], // Drop all script contents. }); // esc filters tags and attributes and escapes significant symbols (eg, "<"). export function esc(s: string) { return filter.process(s); }