anti_xss
v1.0.1
Published
> this module is best suited for component based front-end frameworks > it is best used inside of a lifecycle hook such as in the example below
Downloads
1
Readme
How to use:
this module is best suited for component based front-end frameworks it is best used inside of a lifecycle hook such as in the example below
import antiXss from 'anti_xss';
//call the module function inside of a component lifecycle hook :)
componentDidMount(){
let escapeChars = ['<script>','<SCRIPT>','<Script>','%']
let whiteListURLS = ['http://goodurl','https://greaturl','https://supersafeurl']
antiXss.isSafe("app",escapeChars,whiteListURLS)
}
parameters
| params | description | | ------------- |:-------------------------------:| | "app" | ID of the parent node | | escapeChars | characters not allowed in nodes | | whiteListURLS | array of allowed URLS |