export function associateBy(array, selector) {
    const ret = {};
    for (const element of array) {
        const selectedValue = selector(element);
        ret[selectedValue] = element;
    }
    return ret;
}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXNzb2NpYXRlX2J5LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiYXNzb2NpYXRlX2J5LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQTRCQSxNQUFNLFVBQVUsV0FBVyxDQUN6QixLQUFtQixFQUNuQixRQUEyQjtJQUUzQixNQUFNLEdBQUcsR0FBc0IsRUFBRSxDQUFDO0lBRWxDLEtBQUssTUFBTSxPQUFPLElBQUksS0FBSyxFQUFFO1FBQzNCLE1BQU0sYUFBYSxHQUFHLFFBQVEsQ0FBQyxPQUFPLENBQUMsQ0FBQztRQUV4QyxHQUFHLENBQUMsYUFBYSxDQUFDLEdBQUcsT0FBTyxDQUFDO0tBQzlCO0lBRUQsT0FBTyxHQUFHLENBQUM7QUFDYixDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLy8gQ29weXJpZ2h0IDIwMTgtMjAyMSB0aGUgRGVubyBhdXRob3JzLiBBbGwgcmlnaHRzIHJlc2VydmVkLiBNSVQgbGljZW5zZS5cbi8vIFRoaXMgbW9kdWxlIGlzIGJyb3dzZXIgY29tcGF0aWJsZS5cblxuLyoqXG4gKiBUcmFuc2Zvcm1zIHRoZSBnaXZlbiBhcnJheSBpbnRvIGEgUmVjb3JkLCBleHRyYWN0aW5nIHRoZSBrZXkgb2YgZWFjaCBlbGVtZW50IHVzaW5nIHRoZSBnaXZlbiBzZWxlY3Rvci5cbiAqIElmIHRoZSBzZWxlY3RvciBwcm9kdWNlcyB0aGUgc2FtZSBrZXkgZm9yIG11bHRpcGxlIGVsZW1lbnRzLCB0aGUgbGF0ZXN0IG9uZSB3aWxsIGJlIHVzZWQgKG92ZXJyaWRpbmcgdGhlXG4gKiBvbmVzIGJlZm9yZSBpdCku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