export function getExperimentSettingsFromExperimentList(experimentList) {
    return (
        experimentList
            .filter((x) => !!x.isActive)
            .map((x) => x.settings)
            .reduce((r, c) => Object.assign(r, c), {}) ?? {}
    );
}

export function getSettingValue(settingName, experimentSettings) {
    return hasSetting(settingName, experimentSettings) ? experimentSettings[settingName] : null;
}

export function hasSettingEqualTo(settingName, settingValue, experimentSettings) {
    return experimentSettings[settingName] == settingValue;
}

export function hasSetting(settingName, experimentSettings) {
    return Object.hasOwn(experimentSettings, settingName);
}
