318
export function getConfigurationValue<T>(config: IStringDictionary<unknown>, settingPath: string, defaultValue: T): T;
319
export function getConfigurationValue<T>(config: IStringDictionary<unknown>, settingPath: string, defaultValue?: T): T | undefined {
320
>
function accessSetting(config: IStringDictionary<unknown>, path: string[]): unknown {
configuration.ts
321
>
let current: unknown = config;
322
>
for (const component of path) {
323
>
if (typeof current !== 'object' || current === null) {
324
return undefined;
325
}
326
>
current = (current as IStringDictionary<unknown>)[component];
configuration.ts
327
>
}
328
return current as T;
330
>
331
>
const path = settingPath.split('.');
332
>
const result = accessSetting(config, path);
333
>
334
>
return typeof result === 'undefined' ? defaultValue : result as T;
335
>
}
336
337
export function merge(base: IStringDictionary<unknown>, add: IStringDictionary<unknown>, overwrite: boolean): void {