Typescript Check If Object Is Of Interface In Javascript