Skip to content
This repository has been archived by the owner on Jan 16, 2025. It is now read-only.

Latest commit

 

History

History
66 lines (41 loc) · 1.77 KB

CaseMapper.md

File metadata and controls

66 lines (41 loc) · 1.77 KB

CaseMapper

A class that can map strings to upper and lower case in a locale-sensitive manner.

Kind: global class


new CaseMapper([options])

Create a new string case mapper instance that maps strings to upper or lower case. This mapping will work for any string as characters that have no case will be returned unchanged.

The options may contain any of the following properties:

  • locale - locale to use when loading the mapper. Some maps are locale-dependent, and this locale selects the right one. Default if this is not specified is the current locale.
  • direction - "toupper" for upper-casing, or "tolower" for lower-casing. Default if not specified is "toupper".
Param Type Description
[options] Object options to initialize this mapper

caseMapper.getLocale() ⇒ Locale

Return the locale that this mapper was constructed with.

Kind: instance method of CaseMapper
Returns: Locale - the locale that this mapper was constructed with


caseMapper.map(string) ⇒ string | undefined

Map a string to lower case in a locale-sensitive manner.

Kind: instance method of CaseMapper

Param Type
string string | undefined