monitor/core/lib/xss.js
2025-04-16 22:30:27 +07:00

14 lines
298 B
JavaScript

import xssClass from 'xss';
/**
* Returns a function with the passed whitelist parameter.
* https://github.com/leizongmin/js-xss#whitelist
*/
export default (customWL = []) => {
const xss = new xssClass.FilterXSS({
whiteList: customWL,
});
return (x) => xss.process(x);
};