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): undefined | null | boolean

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

Parses a boolean value from an optional string input.

Parameters
ParameterTypeDescription
inputundefined | null | stringThe input to parse.
Returns

undefined | null | boolean

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): undefined | boolean

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

Parses a boolean value from an optional string input.

Parameters
ParameterTypeDescription
inputundefined | null | stringThe input to parse.
defaultValuebooleanThe default boolean value to return if the input is nullish.
Returns

undefined | boolean

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?): undefined | null | boolean

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

Parses a boolean value from an optional string input.

Parameters
ParameterTypeDescription
inputundefined | null | stringThe 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

undefined | null | boolean

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): undefined | null | number

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

Parses a number value from an optional string input.

Parameters
ParameterTypeDescription
inputundefined | null | stringThe input to parse.
Returns

undefined | null | number

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): undefined | number

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

Parses a number value from an optional string input.

Parameters
ParameterTypeDescription
inputundefined | null | stringThe input to parse.
defaultValuenumberThe default number value to return if the input is nullish.
Returns

undefined | number

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?): undefined | null | number

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

Parses a number value from an optional string input.

Parameters
ParameterTypeDescription
inputundefined | null | stringThe 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

undefined | null | number

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): undefined | null | T

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
inputundefined | null | stringThe input to parse.
validator(value) => booleanA function that checks whether the number value parsed from the input is valid.
Returns

undefined | null | T

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): undefined | T

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
inputundefined | null | stringThe 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

undefined | T

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?): undefined | null | T

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
inputundefined | null | stringThe 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

undefined | null | T

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.