poppinss / indicative

Indicative is a simple yet powerful data validator for Node.js and browsers. It makes it so simple to write async validations on nested set of data.
https://indicative.adonisjs.com/
MIT License
417 stars 52 forks source link

escape replace word #222

Closed wmtamit closed 5 years ago

wmtamit commented 5 years ago

if i try to use escape in name and i write the name like this s>?bi so give me a result like this S Gt Bi .

thetutlage commented 5 years ago

What should be the output?

wmtamit commented 5 years ago

output :- s?bi in indicative doc give escape remove <,> but my cash it don't give output like this

thetutlage commented 5 years ago

Can you share the exact code. I think you are also using the slug sanitization rule and that is converting > to GT

wmtamit commented 5 years ago
get sanitizationRules () {
    return {
      name: 'trim|escape',
      number: 'trim|escape',
      swift_code: 'trim|escape',
      email: 'normalize_email|escape',
      primary_contact_no: 'trim|escape',
      secondary_contact_no: 'trim|escape',
      fax_no: 'trim|escape',
      ...addressValidation.sanitizationRules
    }
}

i use escape like this

thetutlage commented 5 years ago

Added a test for same in the newer version and seems to be working as expected. https://github.com/poppinss/indicative-rules/commit/937733dcff63e5cc20382ceda145c9873e036734