I have the following type defined in typescript
export type Unit =
| 'year'
| 'month'
| 'day'
| 'hour'
| 'minute'
| 'second'
| 'millisecond'
Is there a way to check a string if that string matches any of the above types using typescript?
const x = 'abc'
x "typeOf" Unit => false?
EDIT: Found anwser, have marked question as duplicate