Methods

capitalizeFirstLetter(string, locale) → {string}

Capitalize the first letter of a string.

Parameters:
NameTypeDescription
stringstring

The string to capitalize.

localestring

The locale to use for capitalization.

Since
  • 1.0.0
Returns:

The capitalized string.

Type: 
string

fnvHash(input) → {string}

FNV-1a 64-bit hash function

Parameters:
NameTypeDescription
input*

The input to hash

Since
  • 4.0.2
Returns:

The 64-bit FNV-1a hash of the input as a 16-character hex string

Type: 
string

getValidLocale(locale, fallback) → {string}

Returns a valid locale string.

Parameters:
NameTypeDescription
localestring

The locale string to validate.

fallbackstring

The fallback locale string.

Since
  • 4.0.8
Returns:

The valid locale string.

Type: 
string

sanitizeLocale(locale) → {string}

Sanitizes a locale string by replacing underscores with hyphens.

Parameters:
NameTypeDescription
localestring

The locale string to sanitize.

Since
  • 4.0.8
Returns:

The sanitized locale string.

Type: 
string

uncapitalizeFirstLetter(string, locale) → {string}

Uncapitalize the first letter of a string.

Parameters:
NameTypeDescription
stringstring

The string to uncapitalize.

localestring

The locale to use for uncapitalization.

Since
  • 1.0.0
Returns:

The uncapitalized string.

Type: 
string

(async) wait(ms) → {Promise.<void>}

Wait for a given number of milliseconds.

Parameters:
NameTypeDescription
msnumber

The number of milliseconds to wait.

Since
  • 5.0.2
Returns:

A promise that resolves when the wait is complete.

Type: 
Promise.<void>