"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.parseAndReturnRateModelFromString = void 0;
const expectedRateModelKeys = ["UBar", "R0", "R1", "R2"];
const parseAndReturnRateModelFromString = (rateModelString) => {
    const rateModelFromEvent = JSON.parse(rateModelString);
    for (const key of expectedRateModelKeys) {
        if (!Object.keys(rateModelFromEvent).includes(key)) {
            throw new Error(`Rate model does not contain all expected keys. Expected keys: [${expectedRateModelKeys}], actual keys: [${Object.keys(rateModelFromEvent)}]`);
        }
    }
    for (const key of Object.keys(rateModelFromEvent)) {
        if (!expectedRateModelKeys.includes(key)) {
            throw new Error(`Rate model contains unexpected keys. Expected keys: [${expectedRateModelKeys}], actual keys: [${Object.keys(rateModelFromEvent)}]`);
        }
    }
    return {
        UBar: rateModelFromEvent.UBar,
        R0: rateModelFromEvent.R0,
        R1: rateModelFromEvent.R1,
        R2: rateModelFromEvent.R2,
    };
};
exports.parseAndReturnRateModelFromString = parseAndReturnRateModelFromString;
//# sourceMappingURL=rateModel.js.map