const sanitizationRules = {
message: 'escape'
}
// or
const sanitizationRules = {
message: [
rule('escape')
]
}
Escapes HTML entities. Useful when you want to avoid XSS attacks.
This method will only remove &
, "
, '
, <
and >
characters. For advance escaping
make use of a 3rd party library like he.
const sanitizationRules = {
message: 'escape'
}
// or
const sanitizationRules = {
message: [
rule('escape')
]
}
For customized build, you can import this rule as follows.
import { escape } from 'indicative/builds/validations'