1.0.1 • Published 4 years ago

anti_xss v1.0.1

Weekly downloads
2
License
ISC
Repository
-
Last release
4 years ago

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

paramsdescription
"app"ID of the parent node
escapeCharscharacters not allowed in nodes
whiteListURLSarray of allowed URLS