Class: ConfigUtils
Defined in: src/workingtitle-instruments-g3x-touch/html_ui/Shared/Config/ConfigUtils.ts:4
A utility class for working with configuration objects.
Constructors
Constructor
new ConfigUtils():
ConfigUtils
Returns
ConfigUtils
Methods
parseBoolean()
Call Signature
staticparseBoolean(input):boolean|null|undefined
Defined in: src/workingtitle-instruments-g3x-touch/html_ui/Shared/Config/ConfigUtils.ts:11
Parses a boolean value from an optional string input.
Parameters
| Parameter | Type | Description |
|---|---|---|
input | string | null | undefined | The input to parse. |
Returns
boolean | null | undefined
The boolean value parsed from the specified input, or null if the input was nullish, or undefined if
the input string could not be parsed into a boolean value.
Call Signature
staticparseBoolean(input,defaultValue):boolean|undefined
Defined in: src/workingtitle-instruments-g3x-touch/html_ui/Shared/Config/ConfigUtils.ts:19
Parses a boolean value from an optional string input.
Parameters
| Parameter | Type | Description |
|---|---|---|
input | string | null | undefined | The input to parse. |
defaultValue | boolean | The default boolean value to return if the input is nullish. |
Returns
boolean | undefined
The boolean value parsed from the specified input, or undefined if the input string could not be parsed
into a boolean value.
Call Signature
staticparseBoolean(input,defaultValue?):boolean|null|undefined
Defined in: src/workingtitle-instruments-g3x-touch/html_ui/Shared/Config/ConfigUtils.ts:28
Parses a boolean value from an optional string input.
Parameters
| Parameter | Type | Description |
|---|---|---|
input | string | null | undefined | The input to parse. |
defaultValue? | boolean | The default boolean value to return if the input is nullish. If not defined, then a default value will not be used. |
Returns
boolean | null | undefined
The boolean value parsed from the specified input, or null if the input was nullish and no default
value was specified, or undefined if the input string could not be parsed into a boolean value.
parseNumber()
Call Signature
staticparseNumber(input):number|null|undefined
Defined in: src/workingtitle-instruments-g3x-touch/html_ui/Shared/Config/ConfigUtils.ts:50
Parses a number value from an optional string input.
Parameters
| Parameter | Type | Description |
|---|---|---|
input | string | null | undefined | The input to parse. |
Returns
number | null | undefined
The number value parsed from the specified input, or null if the input was nullish, or undefined if
the input string could not be parsed into a number value.
Call Signature
staticparseNumber(input,defaultValue):number|undefined
Defined in: src/workingtitle-instruments-g3x-touch/html_ui/Shared/Config/ConfigUtils.ts:58
Parses a number value from an optional string input.
Parameters
| Parameter | Type | Description |
|---|---|---|
input | string | null | undefined | The input to parse. |
defaultValue | number | The default number value to return if the input is nullish. |
Returns
number | undefined
The number value parsed from the specified input, or undefined if the input string could not be parsed
into a number value.
Call Signature
staticparseNumber(input,defaultValue?):number|null|undefined
Defined in: src/workingtitle-instruments-g3x-touch/html_ui/Shared/Config/ConfigUtils.ts:67
Parses a number value from an optional string input.
Parameters
| Parameter | Type | Description |
|---|---|---|
input | string | null | undefined | The input to parse. |
defaultValue? | number | The default number value to return if the input is nullish. If not defined, then a default value will not be used. |
Returns
number | null | undefined
The number value parsed from the specified input, or null if the input was nullish and no default value
was specified, or undefined if the input string could not be parsed into a number value.
Call Signature
staticparseNumber<T>(input,validator):T|null|undefined
Defined in: src/workingtitle-instruments-g3x-touch/html_ui/Shared/Config/ConfigUtils.ts:75
Parses a validated number value from an optional string input.
Type Parameters
| Type Parameter | Default type |
|---|---|
T extends number | number |
Parameters
| Parameter | Type | Description |
|---|---|---|
input | string | null | undefined | The input to parse. |
validator | (value) => boolean | A function that checks whether the number value parsed from the input is valid. |
Returns
T | null | undefined
The number value parsed from the specified input, or null if the input was nullish, or undefined if
the input string could not be parsed into a valid number value.
Call Signature
staticparseNumber<T>(input,validator,defaultValue):T|undefined
Defined in: src/workingtitle-instruments-g3x-touch/html_ui/Shared/Config/ConfigUtils.ts:87
Parses a validated number value from an optional string input.
Type Parameters
| Type Parameter | Default type |
|---|---|
T extends number | number |
Parameters
| Parameter | Type | Description |
|---|---|---|
input | string | null | undefined | The input to parse. |
validator | (value) => boolean | A function that checks whether the number value parsed from the input is valid. |
defaultValue | T | The default number value to return if the input is nullish. |
Returns
T | undefined
The number value parsed from the specified input, or undefined if the input string could not be parsed
into a valid number value.
Call Signature
staticparseNumber<T>(input,validator,defaultValue?):T|null|undefined
Defined in: src/workingtitle-instruments-g3x-touch/html_ui/Shared/Config/ConfigUtils.ts:101
Parses a validated number value from an optional string input.
Type Parameters
| Type Parameter | Default type |
|---|---|
T extends number | number |
Parameters
| Parameter | Type | Description |
|---|---|---|
input | string | null | undefined | The input to parse. |
validator | (value) => boolean | A function that checks whether the number value parsed from the input is valid. |
defaultValue? | T | The default number value to return if the input is nullish. If not defined, then a default value will not be used. |
Returns
T | null | undefined
The number value parsed from the specified input, or null if the input was nullish and no default value
was specified, or undefined if the input string could not be parsed into a valid number value.