I have this enum
enum OfferType {
Apartment = 'apartment',
House = 'house',
Room = 'room',
Hotel = 'hotel',
}
Which of the options should be used, when you type the value of the property. When to apply each approach
1)
{
type: type as OfferType
}
{
type: OfferType[type as 'apartment' | 'house' | 'room' | 'hotel']
{