RateGravity / parse-full-name

A function that accepts the full name of a person in any format, parses it, and returns its parts { title, first name, middle name, last name, nickname, suffix, [and any parsing errors] }.
40 stars 13 forks source link

Assume first name if only 1 word is entered #9

Open chris-pardy opened 5 years ago

chris-pardy commented 5 years ago

Thank you for this library. I really like the case-fixing that it provides.

When I call this library like parseFullName('steven'), the result is that steven is returned as the last name. This seems counterintuitive to me and should be returned as the first name.

I'm also encountering the same behaviour and wanted to see if the author/maintainers can discuss the rationale behind this design decision. The behaviour is easy enough to change, but I don't want to make my special case into the general case, because my case could be domain-specific. We work with student names, so in cases where the person who's providing the identity of the student isn't comfortable doing so, we don't make them supply a surname. Thus, in most cases if only a single name is supplied, we should be assuming that it's a given/first name.

chris-pardy commented 5 years ago

Port of dschnelldavis/parse-full-name#1