TypeScript : Possible typo when comparing types