"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.resolveCredential = resolveCredential;
function resolveCredential(world, reference) {
    const [profileName, fieldName] = reference.split('.');
    if (!profileName || !fieldName) {
        throw new Error(`Credential reference must use "profile.field" format. Received: ${reference}`);
    }
    const value = world.config.credentials[profileName]?.[fieldName];
    if (!value) {
        throw new Error(`Credential "${reference}" was not found in bdd-ui.config.json.`);
    }
    return value;
}
