Methods
capitalizeFirstLetter(string, locale) → {string}
Capitalize the first letter of a string.
Parameters:
| Name | Type | Description |
|---|---|---|
string | string | The string to capitalize. |
locale | string | 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:
| Name | Type | Description |
|---|---|---|
input | * | The input to hash |
- Since
- 4.0.2
- Source
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:
| Name | Type | Description |
|---|---|---|
locale | string | The locale string to validate. |
fallback | string | The fallback locale string. |
- Since
- 4.0.8
- Source
Returns:
The valid locale string.
- Type:
- string
sanitizeLocale(locale) → {string}
Sanitizes a locale string by replacing underscores with hyphens.
Parameters:
| Name | Type | Description |
|---|---|---|
locale | string | The locale string to sanitize. |
- Since
- 4.0.8
- Source
Returns:
The sanitized locale string.
- Type:
- string
uncapitalizeFirstLetter(string, locale) → {string}
Uncapitalize the first letter of a string.
Parameters:
| Name | Type | Description |
|---|---|---|
string | string | The string to uncapitalize. |
locale | string | 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:
| Name | Type | Description |
|---|---|---|
ms | number | The number of milliseconds to wait. |
- Since
- 5.0.2
- Source
Returns:
A promise that resolves when the wait is complete.
- Type:
- Promise.<void>