Validator.js: New validation (isName)

Created on 16 Nov 2018  路  4Comments  路  Source: validatorjs/validator.js

Ok so not really an issue - sorry about that Im not familliar with GitHub yet but I didnt find another way to post this.
I forked validator and I created a new file which I believe will be useful to this repo take a look here.

I hope people find this useful and I'd love to hear what's on your mind about this.
Best regards!

marked-for-close 馃嵖 discussion

Most helpful comment

Something to keep in mind when trying to validate names:
https://www.kalzumeus.com/2010/06/17/falsehoods-programmers-believe-about-names/

All 4 comments

Not really sure about this request but would love to hear what the rest of the team says.

Good idea, but I don't think it's much better than removing the spaces from the string then using isAlpha().
Your method also ignores a lot of cases where names can have more than 2 parts.

Something to keep in mind when trying to validate names:
https://www.kalzumeus.com/2010/06/17/falsehoods-programmers-believe-about-names/

@profnandaa @linkinmedo Some states in the US allow numbers in the names, so this feature would just be like isAlphanumeric with option like {ignore_whitespace : true}.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rathboma picture rathboma  路  4Comments

jaxkodex picture jaxkodex  路  3Comments

smohiuddin picture smohiuddin  路  4Comments

malkhuzayyim picture malkhuzayyim  路  4Comments

mfbx9da4 picture mfbx9da4  路  4Comments