@grafana/data: Update xss dependency (#43423)

This commit is contained in:
Todd Treece
2021-12-21 10:55:36 -05:00
committed by GitHub
parent 5db03cf91a
commit dd884dbfd5
3 changed files with 14 additions and 15 deletions
+1 -1
View File
@@ -39,7 +39,7 @@
"rxjs": "7.3.0",
"tslib": "2.3.1",
"uplot": "1.6.16",
"xss": "1.0.6"
"xss": "1.0.10"
},
"devDependencies": {
"@grafana/tsconfig": "^1.0.0-rc1",
+5 -6
View File
@@ -1,13 +1,12 @@
import xss from 'xss';
import { FilterXSS, whiteList, IWhiteList } from 'xss';
import { sanitizeUrl as braintreeSanitizeUrl } from '@braintree/sanitize-url';
const XSSWL = Object.keys(xss.whiteList).reduce((acc, element) => {
// @ts-ignore
acc[element] = xss.whiteList[element].concat(['class', 'style']);
const XSSWL = Object.keys(whiteList).reduce((acc, element) => {
acc[element] = whiteList[element]?.concat(['class', 'style']);
return acc;
}, {});
}, {} as IWhiteList);
const sanitizeXSS = new xss.FilterXSS({
const sanitizeXSS = new FilterXSS({
whiteList: XSSWL,
});