Typescript Loop Through Object Entries In Javascript How To Convert