Validator.js: [FEATURE REQUEST] deburr

Created on 31 Mar 2020  路  6Comments  路  Source: validatorjs/validator.js

deburrs a string with the following characters found in

  • Latin-1 Supplement
  • Latin Extended-A

to basic Latin Characters

deburr('d茅j脿 vu') yields deja vu

lodash already has it, thought of implementing in validator.js

would love to raise a PR if needed

馃檵鈥嶁檪锔廸eature-request

Most helpful comment

I feel like it could be bordering a little beyond the scope of the library; now that conventionally been doing pure _validation_, other than _sanitization_. I might be wrong, let me hear what the rest think...

All 6 comments

What would be the purpose of this?

I find it handy to clean acute accent letters, i.e. converting acute accent letters to plain English

I am not sure how large the audience will be for this, so I wanna know your thoughts on having this will be helpful to others?

I feel like it could be bordering a little beyond the scope of the library; now that conventionally been doing pure _validation_, other than _sanitization_. I might be wrong, let me hear what the rest think...

I think it diverges from the main objective of the library which is mostly string validation

@profnandaa isn't toBoolean toInt toFloat does the same?

i mean we should remove these from our codebase, bcs such functionality can easily be achieved with native js functions, removing these may save up few lines

this indeed will be a breaking change, we can have it as a part of major release

I'm okay with marking such validators for deprecation at some point...

Was this page helpful?
0 / 5 - 0 ratings

Related issues

malkhuzayyim picture malkhuzayyim  路  4Comments

jaxkodex picture jaxkodex  路  3Comments

karladler picture karladler  路  3Comments

philfreo picture philfreo  路  3Comments

zilahir picture zilahir  路  3Comments