I have a type:
type Item = {
cost: number | null
name: string
date: string | null
rating: number | null
}
Is there a way in TS to create a type based on Item, which would have date and rating NonNullable? I could do something like this:
type FullItem = Omit<Item, 'date' | 'rating'> & {
date: NonNullable<Item['date']>
rating: NonNullable<Item['rating']>
}
but it seems a bit cumbersome.