The ceremony is caused not by typescript but your misuse of map. You don’t need to create perserverid as an object first. Instead you could flatten fe.blocks, and then filter by b.serverId and then map to a key,value array and use Object.fromEntries to turn this into a keyed object.
Something like:
And typescript infers the types correctly. But I still wouldn’t write it as one line, and I’d use lodash instead.