Skip to main content

readDurationFromConfig()

Home > @backstage/config > readDurationFromConfig

Reads a duration from a config object.

Signature:

function readDurationFromConfig(config: Config, options?: {
key?: string;
}): HumanDuration;

Parameters

ParameterTypeDescription
configConfigA configuration object
options{ key?: string; }(Optional)

Returns:

HumanDuration

A duration object

Remarks

This does not support optionality; if you want to support optional durations, you need to first check the presence of the target with config.has(...) and then call this function.