How to fix Condition will always be 'true' or 'false' in TypeScript | DevErrors