Socket
Book a DemoInstallSign in
Socket

proper-name-case

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

proper-name-case

Properly case proper nouns

latest
Source
npmnpm
Version
1.1.0
Version published
Weekly downloads
33
-49.23%
Maintainers
1
Weekly downloads
 
Created
Source

Proper Name Name

Attempt 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, MACKENZIE converts to Mackenzie even though some people will case it as MacKenzie

Usage

Pass a string to the convert method. It will return a best effort at converting it to proper name case.

Development

Clone the repo and do your thing. If you add code to cover additional conversions, please make sure they are added to the tests.

Testing

npm run test

The file test-data.js contains a list of names to be converted and the expected results.

Credit

This code is a conversion of the following: https://dialect.ca/code/name-case/name_case.phps

FAQs

Package last updated on 16 May 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts