dschnelldavis / 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] }.
74 stars 15 forks source link

Assume first name if only 1 word is entered #1

Open stevenmusumeche opened 7 years ago

stevenmusumeche commented 7 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.

tcchau commented 6 years ago

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

@stevenmusumeche @tcchau we've taken over ownership of this library I'm moving issues into our fork. Please feel free to comment further on your issue there.

demiro commented 4 years ago

@stevenmusumeche @tcchau we've taken over ownership of this library I'm moving issues into our fork. Please feel free to comment further on your issue there.

hm... great... now where is the fork? :)

stevenmusumeche commented 4 years ago

@demiro https://github.com/RateGravity/parse-full-name

demiro commented 4 years ago

@demiro https://github.com/RateGravity/parse-full-name

this is only a github repo, where is the npm package?

chris-pardy commented 4 years ago

@demiro we took ownership of the NPM package. I've published a minor version bump with us as owners. If you'd like to open up a PR for this issue, please feel free to do so. Otherwise we'll start to address issues shortly. (Currently on a big push to ship some code at work)