SayMyName lets you split human name (into firstname and name) and aims to return the correct letter case.
Installation
With npm
npm install saymyname
In a browser
Usage
// full name constructorvar myName = "jean de la fontaine"; console; // return "Jean de La Fontaine"console; // return "Jean"console; // return "de La Fontaine" // firstname + name constructorvar myName = "JEAN BAPTISE""POQUELIN"; console; // return "Jean-Baptiste Poquelin"console; // return "Jean-Baptise"console; // return "Poquelin"
Limitations
I tried to catch as many case as possible (specially with nobiliary particle) but human naming is not (read: not at all) a science. Many thanks to you, Wikipedia.
Contributions
Feel free to contribute