When I use this code from your examples, I get the error "Type 'never[]' has no properties in common with type 'IWhiteList'.ts(2559)". It seems that the type of whiteList is actually IWhiteList.
Does the example need to be updated? Or the types?
import xss from 'xss';
export default function xssPlainTextOnly(input: string): string {
// https://jsxss.com/en/examples/no_tag.html
return xss(input, {
whiteList: [], // do not allow any tags through
stripIgnoreTag: true, // filter out all HTML not in the whilelist
stripIgnoreTagBody: [ 'script' ], // filter out contents (body) of script tags
});
}
When I use this code from your examples, I get the error "Type 'never[]' has no properties in common with type 'IWhiteList'.ts(2559)". It seems that the type of
whiteList
is actuallyIWhiteList
.Does the example need to be updated? Or the types?