Typescript Get Type From Array To Hashmap Internal Server Error