Constructs an immutable instance of Converter.
Methods
-
format(value) : {string|null}
-
Formats the value using the options provided.
Parameters:
Name Type Description valueV the value to be formatted for display Throws:
if formatting fails.- Type
- Error
Returns:
the localized and formatted value suitable for display- Type
- string | null
-
getHint(): string|null
-
Returns a hint that describes the converter format expected.
Returns:
a hint describing the format the value is expected to be in.- Type
- string | null
-
getOptions(): object
-
Returns the options called with converter initialization.
Returns:
an object of options.- Type
- Object
-
parse(value) : {(V|null)}
-
Parses a String value using the options provided.
Parameters:
Name Type Description valuestring to parse Throws:
if parsing fails- Type
- Error
Returns:
the parsed value.- Type
- (V|null)
-
resolvedOptions(): object
-
Returns an object literal with locale and formatting options computed during initialization of the object. If options was not provided at the time of initialization, the properties will be derived from the locale defaults.
Returns:
an object of resolved options.- Type
- Object