Typescript Check If Object Exists R