Typescript Check If Variable Is Object