Skip to main content

Function: getConfig()

function getConfig(path: string, defaultValue?: unknown): unknown;

Defined in: utils/config/constants.ts:282

Get a configuration value by dot-notation path.

Parameters​

path​

string

Dot-notation path to a configuration value.

defaultValue?​

unknown

Value returned when the path does not exist.

Returns​

unknown

Configuration value, or the provided default value.

Example​

GetConfig("UI_CONSTANTS.DEFAULT_THEME"); // "dark"
getConfig("CONVERSION_FACTORS.METERS_PER_MILE"); // 1609.344