typescript discriminated union vs enum