"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getConfigData = void 0; const types_1 = require("@smithy/types"); const loadSharedConfigFiles_1 = require("./loadSharedConfigFiles"); const getConfigData = (data) => Object.entries(data) .filter(([key]) => { const indexOfSeparator = key.indexOf(loadSharedConfigFiles_1.CONFIG_PREFIX_SEPARATOR); if (indexOfSeparator === -1) { return false; } return Object.values(types_1.IniSectionType).includes(key.substring(0, indexOfSeparator)); }) .reduce((acc, [key, value]) => { const indexOfSeparator = key.indexOf(loadSharedConfigFiles_1.CONFIG_PREFIX_SEPARATOR); const updatedKey = key.substring(0, indexOfSeparator) === types_1.IniSectionType.PROFILE ? key.substring(indexOfSeparator + 1) : key; acc[updatedKey] = value; return acc; }, { ...(data.default && { default: data.default }), }); exports.getConfigData = getConfigData;