Skip to main content

Class: ConfigUtils

Defined in: src/workingtitle-instruments-g3000/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​

static parseBoolean(input): boolean | null | undefined

Defined in: src/workingtitle-instruments-g3000/html_ui/Shared/Config/ConfigUtils.ts:11

Parses a boolean value from an optional string input.

Parameters​
ParameterTypeDescription
inputstring | null | undefinedThe 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​

static parseBoolean(input, defaultValue): boolean | undefined

Defined in: src/workingtitle-instruments-g3000/html_ui/Shared/Config/ConfigUtils.ts:19

Parses a boolean value from an optional string input.

Parameters​
ParameterTypeDescription
inputstring | null | undefinedThe input to parse.
defaultValuebooleanThe 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​

static parseBoolean(input, defaultValue?): boolean | null | undefined

Defined in: src/workingtitle-instruments-g3000/html_ui/Shared/Config/ConfigUtils.ts:28

Parses a boolean value from an optional string input.

Parameters​
ParameterTypeDescription
inputstring | null | undefinedThe input to parse.
defaultValue?booleanThe 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​

static parseNumber(input): number | null | undefined

Defined in: src/workingtitle-instruments-g3000/html_ui/Shared/Config/ConfigUtils.ts:50

Parses a number value from an optional string input.

Parameters​
ParameterTypeDescription
inputstring | null | undefinedThe 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​

static parseNumber(input, defaultValue): number | undefined

Defined in: src/workingtitle-instruments-g3000/html_ui/Shared/Config/ConfigUtils.ts:58

Parses a number value from an optional string input.

Parameters​
ParameterTypeDescription
inputstring | null | undefinedThe input to parse.
defaultValuenumberThe 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​

static parseNumber(input, defaultValue?): number | null | undefined

Defined in: src/workingtitle-instruments-g3000/html_ui/Shared/Config/ConfigUtils.ts:67

Parses a number value from an optional string input.

Parameters​
ParameterTypeDescription
inputstring | null | undefinedThe input to parse.
defaultValue?numberThe 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​

static parseNumber<T>(input, validator): T | null | undefined

Defined in: src/workingtitle-instruments-g3000/html_ui/Shared/Config/ConfigUtils.ts:75

Parses a validated number value from an optional string input.

Type Parameters​
Type ParameterDefault type
T extends numbernumber
Parameters​
ParameterTypeDescription
inputstring | null | undefinedThe input to parse.
validator(value) => booleanA 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​

static parseNumber<T>(input, validator, defaultValue): T | undefined

Defined in: src/workingtitle-instruments-g3000/html_ui/Shared/Config/ConfigUtils.ts:87

Parses a validated number value from an optional string input.

Type Parameters​
Type ParameterDefault type
T extends numbernumber
Parameters​
ParameterTypeDescription
inputstring | null | undefinedThe input to parse.
validator(value) => booleanA function that checks whether the number value parsed from the input is valid.
defaultValueTThe 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​

static parseNumber<T>(input, validator, defaultValue?): T | null | undefined

Defined in: src/workingtitle-instruments-g3000/html_ui/Shared/Config/ConfigUtils.ts:101

Parses a validated number value from an optional string input.

Type Parameters​
Type ParameterDefault type
T extends numbernumber
Parameters​
ParameterTypeDescription
inputstring | null | undefinedThe input to parse.
validator(value) => booleanA function that checks whether the number value parsed from the input is valid.
defaultValue?TThe 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.