export default function keyById( items: T[] ): Map { const ret = new Map(); for (const item of items) { ret.set(item.id, item); } return ret; }