Typescript Get First From Array To Hashmap In Python