Skip to main content
Version: Next

readDurationFromConfig()

Home > @backstage/config > readDurationFromConfig

Reads a duration from a config object.

Signature:

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

Parameters

Parameter

Type

Description

config

Config

A 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.