"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.arrayToRecord = arrayToRecord;
function arrayToRecord(items, keyProp, valueProp) {
    // Handle entries format [string, value][]
    if (items.length > 0 && Array.isArray(items[0]) && items[0].length === 2) {
        return items.reduce((acc, [key, value]) => Object.assign(acc, { [key]: value }), {});
    }
    // Handle object array format with key and value properties
    if (keyProp !== undefined && valueProp !== undefined) {
        return items
            .map((item) => ({
            [String(item[keyProp])]: item[valueProp],
        }))
            .reduce((acc, cur) => Object.assign(acc, cur), {});
    }
    throw new Error("Invalid arguments for arrayToRecord");
}
//# sourceMappingURL=arrayToRecord.js.map