Typescript Cannot Read Properties Of Undefined Enumerate