Proper Name NameAttempt to properly case a person's name. It should noted that without creating a massive lookup table this can only be partially complete. This module adjusts casing based on patterns of common casing quirks (O'Brien, McDonald, Baron von Mustache, etc.) but there will always be exceptions. For example,
Mackenzieeven though some people will case it as
UsagePass a string to the
convertmethod. It will return a best effort at converting it to proper name case.
DevelopmentClone the repo and do your thing. If you add code to cover additional conversions, please make sure they are added to the tests.
Testingnpm run test
test-data.jscontains a list of names to be converted and the expected results.